diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-15 08:05:18 +0200 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-29 19:25:58 +0100 |
commit | 5560a963e048f6bb000fc37b7e7ad73dbe96f3ab (patch) | |
tree | 7eb2a134c91074f8df591bbf65ca75f118ac6ec9 | |
parent | ab71544499679685877cd7bd683ba4556b4331f2 (diff) | |
download | garage-5560a963e048f6bb000fc37b7e7ad73dbe96f3ab.tar.gz garage-5560a963e048f6bb000fc37b7e7ad73dbe96f3ab.zip |
decrease write quorum
-rw-r--r-- | src/table/replication/fullcopy.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/table/replication/fullcopy.rs b/src/table/replication/fullcopy.rs index 1e52bb47..39e29580 100644 --- a/src/table/replication/fullcopy.rs +++ b/src/table/replication/fullcopy.rs @@ -43,13 +43,10 @@ impl TableReplication for TableFullReplication { } fn write_quorum(&self) -> usize { let nmembers = self.system.cluster_layout().current().all_nodes().len(); - - let max_faults = if nmembers > 1 { 1 } else { 0 }; - - if nmembers > max_faults { - nmembers - max_faults - } else { + if nmembers < 3 { 1 + } else { + nmembers.div_euclid(2) + 1 } } |