Skip to content

Commit

Permalink
Put OffloadedTimeline into Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
arpad-m committed Sep 30, 2024
1 parent 386ab88 commit 1b4212d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pageserver/src/tenant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub struct Tenant {
timelines_creating: std::sync::Mutex<HashSet<TimelineId>>,

/// Possibly offloaded and archived timelines
timelines_offloaded: Mutex<HashMap<TimelineId, OffloadedTimeline>>,
timelines_offloaded: Mutex<HashMap<TimelineId, Arc<OffloadedTimeline>>>,

// This mutex prevents creation of new timelines during GC.
// Adding yet another mutex (in addition to `timelines`) is needed because holding
Expand Down
2 changes: 1 addition & 1 deletion pageserver/src/tenant/timeline/offload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub(crate) async fn offload_timeline(
let mut offloaded_timelines = tenant.timelines_offloaded.lock().unwrap();
offloaded_timelines.insert(
timeline.timeline_id,
OffloadedTimeline::from_timeline(&timeline),
Arc::new(OffloadedTimeline::from_timeline(&timeline)),
);
}

Expand Down

0 comments on commit 1b4212d

Please sign in to comment.