decrease write quorum

This commit is contained in:
Quentin 2024-05-15 08:05:18 +02:00
parent afad62939e
commit 6558c15863
Signed by untrusted user: quentin
GPG key ID: E9602264D639FF68

View file

@ -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
}
}