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
…8534)

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)

Production deployments continue to use `mode=page-cache` for the time
being: neondatabase/infra#1655

refs #7418
  • Loading branch information
problame authored and arpad-m committed Aug 5, 2024
1 parent 7c40266 commit 010203a
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 010203a

Please sign in to comment.