aboutsummaryrefslogtreecommitdiff
path: root/src/table/table_sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-24 11:05:59 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-24 11:05:59 +0100
commit09fd6ea7f02f5e8a7642942c52227056464b8833 (patch)
treec6541bd31f3b5cb29b581520f803c0077056280d /src/table/table_sync.rs
parenta52ab696403ebb824618e0f18ef9f4e707648439 (diff)
downloadgarage-09fd6ea7f02f5e8a7642942c52227056464b8833.tar.gz
garage-09fd6ea7f02f5e8a7642942c52227056464b8833.zip
I was tired yesterday
Diffstat (limited to 'src/table/table_sync.rs')
-rw-r--r--src/table/table_sync.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/table/table_sync.rs b/src/table/table_sync.rs
index 58391274..2c984226 100644
--- a/src/table/table_sync.rs
+++ b/src/table/table_sync.rs
@@ -319,7 +319,7 @@ where
}
counter += 1;
- debug!("Offloading items from {:?}..{:?} ({})", begin, end, counter);
+ debug!("Offloading {} items from {:?}..{:?} ({})", items.len(), begin, end, counter);
self.offload_items(&items, &nodes[..]).await?;
} else {
break;
@@ -348,8 +348,15 @@ where
}
// All remote nodes have written those items, now we can delete them locally
+ let mut not_removed = 0;
for (k, v) in items.iter() {
- self.table.delete_if_equal(&k[..], &v[..])?;
+ if !self.table.delete_if_equal(&k[..], &v[..])? {
+ not_removed += 1;
+ }
+ }
+
+ if not_removed > 0 {
+ debug!("{} items not removed during offload because they changed in between (trying again...)", not_removed);
}
Ok(())