cli: add layout history and layout assume-sync commands

This commit is contained in:
Alex Auvolat
2023-11-27 16:17:41 +01:00
parent 539a920313
commit 11e6fef93c
4 changed files with 147 additions and 3 deletions
+8 -1
View File
@@ -391,7 +391,10 @@ impl UpdateTracker {
changed
}
pub(crate) fn set_max(&mut self, peer: Uuid, value: u64) -> bool {
/// This bumps the update tracker for a given node up to the specified value.
/// This has potential impacts on the correctness of Garage and should only
/// be used in very specific circumstances.
pub fn set_max(&mut self, peer: Uuid, value: u64) -> bool {
match self.0.get_mut(&peer) {
Some(e) if *e < value => {
*e = value;
@@ -412,6 +415,10 @@ impl UpdateTracker {
.min()
.unwrap_or(min_version)
}
pub fn get(&self, node: &Uuid) -> u64 {
self.0.get(node).copied().unwrap_or(0)
}
}
impl UpdateTrackers {