mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-15 09:22:55 +00:00
plumbing: collect timelines index parts
This commit is contained in:
@@ -1003,7 +1003,7 @@ impl Tenant {
|
||||
.remove(&timeline_id)
|
||||
.expect("just put it in above");
|
||||
|
||||
shared_state_builder.record_loading_timeline(&index_part);
|
||||
shared_state_builder.record_loading_timeline(&timeline_id, &index_part);
|
||||
|
||||
// TODO again handle early failure
|
||||
self.load_remote_timeline(
|
||||
|
||||
@@ -236,12 +236,24 @@ impl Attempt {
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct SharedStateBuilder {}
|
||||
pub(crate) struct SharedStateBuilder {
|
||||
inprogress: std::collections::HashSet<TimelineId>,
|
||||
}
|
||||
|
||||
impl SharedStateBuilder {
|
||||
/// While loading, visit a timelines persistent [`crate::tenant::IndexPart`] and record if it is being
|
||||
/// detached.
|
||||
pub(crate) fn record_loading_timeline(&mut self, _index_part: &crate::tenant::IndexPart) {}
|
||||
pub(crate) fn record_loading_timeline(
|
||||
&mut self,
|
||||
timeline_id: &TimelineId,
|
||||
index_part: &crate::tenant::IndexPart,
|
||||
) {
|
||||
if index_part.ongoing_detach_ancestor.is_some() {
|
||||
// if the loading a timeline fails, tenant loading must fail as it does right now, or
|
||||
// something more elaborate needs to be done with this tracking
|
||||
self.inprogress.insert(*timeline_id);
|
||||
}
|
||||
}
|
||||
|
||||
/// Merge the loaded not yet deleting in-progress to the existing datastructure.
|
||||
pub(crate) fn build(self, _target: &SharedState) {}
|
||||
|
||||
Reference in New Issue
Block a user