From 6f9685bcba2faced1756b6f6784bf510e889d2d3 Mon Sep 17 00:00:00 2001 From: Alex Chi Z Date: Tue, 23 Jul 2024 14:19:57 -0400 Subject: [PATCH] fix tests + fmt Signed-off-by: Alex Chi Z --- pageserver/src/tenant.rs | 3 ++- pageserver/src/tenant/timeline/compaction.rs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 259fd25e6c8b1..cb3ca9c8b9bc6 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -7341,7 +7341,8 @@ mod tests { #[tokio::test] async fn test_simple_bottom_most_compaction_with_retain_lsns() -> anyhow::Result<()> { - let harness = TenantHarness::create("test_simple_bottom_most_compaction_with_retain_lsns").await?; + let harness = + TenantHarness::create("test_simple_bottom_most_compaction_with_retain_lsns").await?; let (tenant, ctx) = harness.load().await; fn get_key(id: u32) -> Key { diff --git a/pageserver/src/tenant/timeline/compaction.rs b/pageserver/src/tenant/timeline/compaction.rs index b1383a105eb5c..82b7845fde206 100644 --- a/pageserver/src/tenant/timeline/compaction.rs +++ b/pageserver/src/tenant/timeline/compaction.rs @@ -1281,7 +1281,11 @@ impl Timeline { if cfg!(debug_assertions) { assert_eq!( lowest_retain_lsn, - *retain_lsns_below_horizon.iter().min().unwrap() + *retain_lsns_below_horizon + .iter() + .min() + .copied() + .unwrap_or(gc_cutoff) ); } info!(