From d4a86a415bb87a4cb6640d75e997f7f252ec1b31 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 9 Jun 2023 16:26:04 +0200 Subject: [PATCH] fix it, the way this failed was far from obvious (took a page_cache deep dive) --- pageserver/src/tenant.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index fb2cab46fa..44f03300a9 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -1340,8 +1340,9 @@ impl Tenant { .context("commit init_empty modification")?; let mut timelines = self.timelines.lock().unwrap(); - // Call with `load_layers=true` to get next_open_layer set up. - let tl = uninit_tl.initialize_with_lock(ctx, &mut timelines, true)?; + // load_layers=false because create_empty_timeline already did that what's necessary (set next_open_layer) + // and modification.init_empty() already created layers. + let tl = uninit_tl.initialize_with_lock(ctx, &mut timelines, false)?; // The non-test code would call tl.activate() here. tl.set_state(TimelineState::Active); Ok(tl)