Skip to content

Commit

Permalink
l0_flush: use mode=direct by default => coverage in automated tests
Browse files Browse the repository at this point in the history
Testing in staging and pre-prod has been [going
well](#7418 (comment)).

This PR enables mode=direct by default, thereby providing additional
coverage in the automated tests:
- Rust tests
- Integration tests
- Nightly pagebench (likely irrelevant because it's read-only)
  • Loading branch information
problame committed Jul 29, 2024
1 parent 2416da3 commit 53c9d49
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pageserver/src/l0_flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ use std::{num::NonZeroUsize, sync::Arc};

use crate::tenant::ephemeral_file;

#[derive(Default, Debug, PartialEq, Eq, Clone, serde::Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize)]
#[serde(tag = "mode", rename_all = "kebab-case", deny_unknown_fields)]
pub enum L0FlushConfig {
#[default]
PageCached,
#[serde(rename_all = "snake_case")]
Direct { max_concurrency: NonZeroUsize },
Direct {
max_concurrency: NonZeroUsize,
},
}

impl Default for L0FlushConfig {
fn default() -> Self {
Self::Direct {
// TODO: using num_cpus results in different peak memory usage on different instance types.
max_concurrency: NonZeroUsize::new(usize::max(1, num_cpus::get())).unwrap(),
}
}
}

#[derive(Clone)]
Expand Down

0 comments on commit 53c9d49

Please sign in to comment.