From 4c67de446d6cf9c4c0399fce9c976ac2981f74b5 Mon Sep 17 00:00:00 2001 From: Vlad Lazar Date: Wed, 18 Jun 2025 15:42:52 +0200 Subject: [PATCH] fixup: init offloaded timelines list before gc info init --- pageserver/src/tenant.rs | 8 +++----- pageserver/src/tenant/timeline.rs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index a1be06ab2e..a3543f6c2f 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -1862,7 +1862,9 @@ impl TenantShard { // Now compute the layer visibility for all (not offloaded) timelines. let compute_visiblity_for = { let timelines_accessor = self.timelines.lock().unwrap(); - let timelines_offloaded_accessor = self.timelines_offloaded.lock().unwrap(); + let mut timelines_offloaded_accessor = self.timelines_offloaded.lock().unwrap(); + + timelines_offloaded_accessor.extend(offloaded_timelines_list.into_iter()); // Before activation, populate each Timeline's GcInfo with information about its children self.initialize_gc_info(&timelines_accessor, &timelines_offloaded_accessor, None); @@ -1898,10 +1900,6 @@ impl TenantShard { .context("resume_deletion") .map_err(LoadLocalTimelineError::ResumeDeletion)?; } - { - let mut offloaded_timelines_accessor = self.timelines_offloaded.lock().unwrap(); - offloaded_timelines_accessor.extend(offloaded_timelines_list.into_iter()); - } // Stash the preloaded tenant manifest, and upload a new manifest if changed. // diff --git a/pageserver/src/tenant/timeline.rs b/pageserver/src/tenant/timeline.rs index 232403baef..f577b89edb 100644 --- a/pageserver/src/tenant/timeline.rs +++ b/pageserver/src/tenant/timeline.rs @@ -5897,7 +5897,7 @@ impl Drop for Timeline { if let Ok(mut gc_info) = ancestor.gc_info.write() { if !gc_info.remove_child_not_offloaded(self.timeline_id) { tracing::error!(tenant_id = %self.tenant_shard_id.tenant_id, shard_id = %self.tenant_shard_id.shard_slug(), timeline_id = %self.timeline_id, - "Couldn't remove retain_lsn entry from offloaded timeline's parent: already removed"); + "Couldn't remove retain_lsn entry from timeline's parent on drop: already removed"); } } }