diff --git a/libs/pageserver_api/src/config.rs b/libs/pageserver_api/src/config.rs index 5866145690..cc6e4a3699 100644 --- a/libs/pageserver_api/src/config.rs +++ b/libs/pageserver_api/src/config.rs @@ -260,11 +260,10 @@ pub struct TenantConfigToml { /// Level0 delta layer threshold at which to delay layer flushes for compaction backpressure, /// such that they take 2x as long, and start waiting for layer flushes during ephemeral layer /// rolls. This helps compaction keep up with WAL ingestion, and avoids read amplification - /// blowing up. Should be >compaction_threshold. If None, defaults to 2 * compaction_threshold. - /// 0 to disable. + /// blowing up. Should be >compaction_threshold. 0 to disable. Disabled by default. pub l0_flush_delay_threshold: Option, - /// Level0 delta layer threshold at which to stall layer flushes. 0 to disable. If None, - /// defaults to 4 * compaction_threshold. Must be >compaction_threshold to avoid deadlock. + /// Level0 delta layer threshold at which to stall layer flushes. Must be >compaction_threshold + /// to avoid deadlock. 0 to disable. Disabled by default. pub l0_flush_stall_threshold: Option, // Determines how much history is retained, to allow // branching and read replicas at an older point in time. diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 61981db24a..280a3baa21 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -2172,8 +2172,8 @@ impl Timeline { } fn get_l0_flush_delay_threshold(&self) -> Option { - // Default to delay L0 flushes at 3x compaction threshold. - const DEFAULT_L0_FLUSH_DELAY_FACTOR: usize = 3; + // Disable L0 flushes by default. This and compaction needs further tuning. + const DEFAULT_L0_FLUSH_DELAY_FACTOR: usize = 0; // TODO: default to e.g. 3 // If compaction is disabled, don't delay. if self.get_compaction_period() == Duration::ZERO { @@ -2201,10 +2201,9 @@ impl Timeline { } fn get_l0_flush_stall_threshold(&self) -> Option { - // Default to stall L0 flushes at 5x compaction threshold. - // TODO: stalls are temporarily disabled by default, see below. - #[allow(unused)] - const DEFAULT_L0_FLUSH_STALL_FACTOR: usize = 5; + // Disable L0 stalls by default. In ingest benchmarks, we see image compaction take >10 + // minutes, blocking L0 compaction, and we can't stall L0 flushes for that long. + const DEFAULT_L0_FLUSH_STALL_FACTOR: usize = 0; // TODO: default to e.g. 5 // If compaction is disabled, don't stall. if self.get_compaction_period() == Duration::ZERO { @@ -2236,13 +2235,8 @@ impl Timeline { return None; } - // Disable stalls by default. In ingest benchmarks, we see image compaction take >10 - // minutes, blocking L0 compaction, and we can't stall L0 flushes for that long. - // - // TODO: fix this. - // let l0_flush_stall_threshold = l0_flush_stall_threshold - // .unwrap_or(DEFAULT_L0_FLUSH_STALL_FACTOR * compaction_threshold); - let l0_flush_stall_threshold = l0_flush_stall_threshold?; + let l0_flush_stall_threshold = l0_flush_stall_threshold + .unwrap_or(DEFAULT_L0_FLUSH_STALL_FACTOR * compaction_threshold); // 0 disables backpressure. if l0_flush_stall_threshold == 0 {