aboutsummaryrefslogtreecommitdiff
path: root/src/table_sync.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-19 20:36:36 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-19 20:36:36 +0000
commit5ae32972efaba357ecc0027fe852d710b16b6d0e (patch)
treec49938469ac6f01c1501a79f96260269a410b739 /src/table_sync.rs
parenta54f3158f12cbc69107b0a65af6c2e56fda5b2d7 (diff)
downloadgarage-5ae32972efaba357ecc0027fe852d710b16b6d0e.tar.gz
garage-5ae32972efaba357ecc0027fe852d710b16b6d0e.zip
Implement repair command
Diffstat (limited to 'src/table_sync.rs')
-rw-r--r--src/table_sync.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/table_sync.rs b/src/table_sync.rs
index e394ba0d..2fb5de77 100644
--- a/src/table_sync.rs
+++ b/src/table_sync.rs
@@ -220,11 +220,17 @@ where
})
.collect::<FuturesUnordered<_>>();
+ let mut n_errors = 0;
while let Some(r) = sync_futures.next().await {
if let Err(e) = r {
+ n_errors += 1;
eprintln!("({}) Sync error: {}", self.table.name, e);
}
}
+ if n_errors > self.table.replication.max_write_errors() {
+ return Err(Error::Message(format!("Sync failed with too many nodes.")));
+ }
+
if !partition.retain {
self.table
.delete_range(&partition.begin, &partition.end)