aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/layout/history.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/layout/history.rs')
-rw-r--r--src/rpc/layout/history.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs
index 653d2a48..7d4a1b48 100644
--- a/src/rpc/layout/history.rs
+++ b/src/rpc/layout/history.rs
@@ -18,6 +18,7 @@ impl LayoutHistory {
LayoutHistory {
versions: vec![version],
+ old_versions: vec![],
update_trackers: Default::default(),
staging: Lww::raw(0, staging),
}
@@ -86,11 +87,20 @@ impl LayoutHistory {
.min(&all_nongateway_nodes, min_version);
if self.min_stored() < sync_ack_map_min {
let removed = self.versions.remove(0);
- info!("Layout history: pruning old version {}", removed.version);
+ info!(
+ "Layout history: moving version {} to old_versions",
+ removed.version
+ );
+ self.old_versions.push(removed);
} else {
break;
}
}
+
+ while self.old_versions.len() > OLD_VERSION_COUNT {
+ let removed = self.old_versions.remove(0);
+ info!("Layout history: removing old_version {}", removed.version);
+ }
}
pub(crate) fn clamp_update_trackers(&mut self, nodes: &[Uuid]) {