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 Jul 29, 2024
1 parent d09dad0 commit 4be5852
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

1 comment on commit 4be5852

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3138 tests run: 3017 passed, 0 failed, 121 skipped (full report)


Code coverage* (full report)

  • functions: 32.8% (7017 of 21371 functions)
  • lines: 50.1% (55864 of 111581 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
4be5852 at 2024-07-29T15:48:19.446Z :recycle:

Please sign in to comment.