mirror of
https://git.deuxfleurs.fr/Deuxfleurs/garage.git
synced 2024-11-24 09:01:02 +00:00
decrease write quorum
This commit is contained in:
parent
afad62939e
commit
6558c15863
1 changed files with 3 additions and 6 deletions
|
@ -43,13 +43,10 @@ impl TableReplication for TableFullReplication {
|
||||||
}
|
}
|
||||||
fn write_quorum(&self) -> usize {
|
fn write_quorum(&self) -> usize {
|
||||||
let nmembers = self.system.cluster_layout().current().all_nodes().len();
|
let nmembers = self.system.cluster_layout().current().all_nodes().len();
|
||||||
|
if nmembers < 3 {
|
||||||
let max_faults = if nmembers > 1 { 1 } else { 0 };
|
|
||||||
|
|
||||||
if nmembers > max_faults {
|
|
||||||
nmembers - max_faults
|
|
||||||
} else {
|
|
||||||
1
|
1
|
||||||
|
} else {
|
||||||
|
nmembers.div_euclid(2) + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue