aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-15 13:07:42 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-15 13:07:42 +0100
commitacd49de9f97bd27409232691262bd5827983388d (patch)
tree2cf94185f5bf6c720ca3cb0eee827d165e2b7daa /src/rpc
parent46007bf01dd2e5b489d145ca0a5499ffa7257b96 (diff)
downloadgarage-acd49de9f97bd27409232691262bd5827983388d.tar.gz
garage-acd49de9f97bd27409232691262bd5827983388d.zip
rpc: fix write set quorums
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rpc_helper.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rpc/rpc_helper.rs b/src/rpc/rpc_helper.rs
index 12d073b6..1bad495b 100644
--- a/src/rpc/rpc_helper.rs
+++ b/src/rpc/rpc_helper.rs
@@ -327,7 +327,13 @@ impl RpcHelper {
Ok(successes)
} else {
let errors = errors.iter().map(|e| format!("{}", e)).collect::<Vec<_>>();
- Err(Error::Quorum(quorum, successes.len(), to.len(), errors))
+ Err(Error::Quorum(
+ quorum,
+ None,
+ successes.len(),
+ to.len(),
+ errors,
+ ))
}
}
@@ -469,7 +475,7 @@ impl RpcHelper {
}
}
- if set_counters.iter().all(|x| x.0 > quorum) {
+ if set_counters.iter().all(|x| x.0 >= quorum) {
// Success
// Continue all other requets in background
@@ -492,6 +498,12 @@ impl RpcHelper {
// Failure, could not get quorum
let errors = errors.iter().map(|e| format!("{}", e)).collect::<Vec<_>>();
- Err(Error::Quorum(quorum, successes.len(), peers.len(), errors))
+ Err(Error::Quorum(
+ quorum,
+ Some(to_sets.len()),
+ successes.len(),
+ peers.len(),
+ errors,
+ ))
}
}