Skip to content

Commit

Permalink
Don't keep around the timeline's remote_client
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arpad-m committed Oct 30, 2024
1 parent 4ef7421 commit 3d61dfc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,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<Arc<RemoteTimelineClient>>,

/// 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,
Expand All @@ -547,7 +540,6 @@ impl OffloadedTimeline {
ancestor_retain_lsn,
archived_at,

remote_client: Some(timeline.remote_client.clone()),
delete_progress: timeline.delete_progress.clone(),
})
}
Expand All @@ -564,7 +556,6 @@ impl OffloadedTimeline {
ancestor_timeline_id,
ancestor_retain_lsn,
archived_at,
remote_client: None,
delete_progress: TimelineDeleteProgress::default(),
}
}
Expand Down Expand Up @@ -629,7 +620,7 @@ impl TimelineOrOffloaded {
fn maybe_remote_client(&self) -> Option<Arc<RemoteTimelineClient>> {
match self {
TimelineOrOffloaded::Timeline(timeline) => Some(timeline.remote_client.clone()),
TimelineOrOffloaded::Offloaded(offloaded) => offloaded.remote_client.clone(),
TimelineOrOffloaded::Offloaded(offloaded) => None,
}
}
}
Expand Down

0 comments on commit 3d61dfc

Please sign in to comment.