diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs index af2cbc63..dc454727 100644 --- a/src/rpc/layout/history.rs +++ b/src/rpc/layout/history.rs @@ -107,11 +107,6 @@ impl LayoutHistory { ); self.old_versions.push(removed); } - - 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]) { @@ -230,7 +225,7 @@ impl LayoutHistory { let mut changed = false; // Add any new versions to history - for v2 in other.versions.iter() { + for v2 in other.old_versions.iter().chain(other.versions.iter()) { if let Some(v1) = self.versions.iter().find(|v| v.version == v2.version) { // Version is already present, check consistency if v1 != v2 { diff --git a/src/rpc/layout/mod.rs b/src/rpc/layout/mod.rs index 33676c37..37a558fe 100644 --- a/src/rpc/layout/mod.rs +++ b/src/rpc/layout/mod.rs @@ -231,9 +231,6 @@ mod v010 { use std::collections::BTreeMap; pub use v09::{LayoutParameters, NodeRole, NodeRoleV, ZoneRedundancy}; - /// Number of old (non-live) versions to keep, see LayoutHistory::old_versions - pub const OLD_VERSION_COUNT: usize = 5; - /// The history of cluster layouts, with trackers to keep a record /// of which nodes are up-to-date to current cluster data #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]