aboutsummaryrefslogtreecommitdiff
path: root/src/model/key_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-11-20 20:12:32 +0100
committerAlex Auvolat <alex@adnab.me>2020-11-20 20:12:32 +0100
commit2dc9a4802279a0b7e742f8cf2e2cc85956bb7f83 (patch)
treedd0a52aa12a89ee37cf6e4be2afeefd23ba88f72 /src/model/key_table.rs
parente9fd265ce6d326425994ccfea9d5afc7165460db (diff)
downloadgarage-2dc9a4802279a0b7e742f8cf2e2cc85956bb7f83.tar.gz
garage-2dc9a4802279a0b7e742f8cf2e2cc85956bb7f83.zip
Fix reconciliation logic
Diffstat (limited to 'src/model/key_table.rs')
-rw-r--r--src/model/key_table.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/model/key_table.rs b/src/model/key_table.rs
index f912b11c..05b938ce 100644
--- a/src/model/key_table.rs
+++ b/src/model/key_table.rs
@@ -104,6 +104,11 @@ impl Entry<EmptyKey, String> for Key {
}
fn merge(&mut self, other: &Self) {
+ if other.name_timestamp > self.name_timestamp {
+ self.name_timestamp = other.name_timestamp;
+ self.name = other.name.clone();
+ }
+
if other.deleted {
self.deleted = true;
}
@@ -111,10 +116,6 @@ impl Entry<EmptyKey, String> for Key {
self.authorized_buckets.clear();
return;
}
- if other.name_timestamp > self.name_timestamp {
- self.name_timestamp = other.name_timestamp;
- self.name = other.name.clone();
- }
for ab in other.authorized_buckets.iter() {
match self