From bcfe013094a962a62c217fb41e7d02c01361505f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Wed, 30 Oct 2024 18:44:29 +0100 Subject: [PATCH] Don't keep around the timeline's remote_client (#9583) Constructing a remote client is no big deal. Yes, it means an extra download from S3 but it's not that expensive. This simplifies code paths and scenarios to test. This unifies timelines that have been recently offloaded with timelines that have been offloaded in an earlier invocation of the process. Part of #8088 --- pageserver/src/tenant.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pageserver/src/tenant.rs b/pageserver/src/tenant.rs index 90d9feeeb6..8237f4662c 100644 --- a/pageserver/src/tenant.rs +++ b/pageserver/src/tenant.rs @@ -521,13 +521,6 @@ pub struct OffloadedTimeline { /// Present for future flattening deliberations. pub archived_at: NaiveDateTime, - /// Lazily constructed remote client for the timeline - /// - /// If we offload a timeline, we keep around the remote client - /// for the duration of the process. If we find it through the - /// manifest, we don't construct it up until it's needed (deletion). - pub remote_client: Option>, - /// Prevent two tasks from deleting the timeline at the same time. If held, the /// timeline is being deleted. If 'true', the timeline has already been deleted. pub delete_progress: TimelineDeleteProgress, @@ -554,7 +547,6 @@ impl OffloadedTimeline { ancestor_retain_lsn, archived_at, - remote_client: Some(timeline.remote_client.clone()), delete_progress: timeline.delete_progress.clone(), }) } @@ -571,7 +563,6 @@ impl OffloadedTimeline { ancestor_timeline_id, ancestor_retain_lsn, archived_at, - remote_client: None, delete_progress: TimelineDeleteProgress::default(), } } @@ -636,7 +627,7 @@ impl TimelineOrOffloaded { fn maybe_remote_client(&self) -> Option> { match self { TimelineOrOffloaded::Timeline(timeline) => Some(timeline.remote_client.clone()), - TimelineOrOffloaded::Offloaded(offloaded) => offloaded.remote_client.clone(), + TimelineOrOffloaded::Offloaded(_offloaded) => None, } } }