diff options
author | Alex Auvolat <alex@adnab.me> | 2023-11-11 13:10:59 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-11-11 13:10:59 +0100 |
commit | 9a491fa1372a23e91c793ee1d2b313607752826a (patch) | |
tree | c581d11c7b23aef30a9f770b30d494346f83d4a8 /src/rpc/layout/history.rs | |
parent | df24bb806d64d5d5e748c35efe3f49ad3dda709e (diff) | |
download | garage-9a491fa1372a23e91c793ee1d2b313607752826a.tar.gz garage-9a491fa1372a23e91c793ee1d2b313607752826a.zip |
layout: fix test
Diffstat (limited to 'src/rpc/layout/history.rs')
-rw-r--r-- | src/rpc/layout/history.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rpc/layout/history.rs b/src/rpc/layout/history.rs index cef56647..050f5d0a 100644 --- a/src/rpc/layout/history.rs +++ b/src/rpc/layout/history.rs @@ -18,7 +18,7 @@ impl LayoutHistory { }; let mut ret = LayoutHistory { - versions: vec![version].into_boxed_slice().into(), + versions: vec![version], update_trackers: Default::default(), trackers_hash: [0u8; 32].into(), staging: Lww::raw(0, staging), @@ -211,6 +211,11 @@ To know the correct value of the new layout version, invoke `garage layout show` let msg = new_version.calculate_partition_assignment()?; self.versions.push(new_version); + if self.current().check().is_ok() { + while self.versions.first().unwrap().check().is_err() { + self.versions.remove(0); + } + } // Reset the staged layout changes self.staging.update(LayoutStaging { @@ -245,7 +250,7 @@ To know the correct value of the new layout version, invoke `garage layout show` version.check()?; } - // TODO: anythign more ? + // TODO: anything more ? Ok(()) } } |