mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-05 20:37:41 +00:00
cli: add layout history and layout assume-sync commands
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user