diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-05-15 08:05:18 +0200 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-27 22:00:36 +0100 |
commit | 27ac0b272ce8b008130610a59739bb7d0928c128 (patch) | |
tree | befb102955ef9930bb583260dfdb75c61bb7f586 /src | |
parent | a1d081ee840b1727ba1b3f430638a1296738283e (diff) | |
download | garage-27ac0b272ce8b008130610a59739bb7d0928c128.tar.gz garage-27ac0b272ce8b008130610a59739bb7d0928c128.zip |
decrease write quorum
Diffstat (limited to 'src')
-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 } } |