diff options
Diffstat (limited to 'src/table_sync.rs')
-rw-r--r-- | src/table_sync.rs | 6 |
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) |