table: take into account multiple write sets in inserts

This commit is contained in:
Alex Auvolat
2023-11-14 15:40:46 +01:00
parent 3b361d2959
commit 90e1619b1e
6 changed files with 190 additions and 135 deletions
+3 -4
View File
@@ -354,8 +354,7 @@ impl BlockManager {
/// Send block to nodes that should have it
pub async fn rpc_put_block(&self, hash: Hash, data: Bytes) -> Result<(), Error> {
// TODO: use quorums among latest write set
let who = self.replication.storage_nodes(&hash);
let who = self.replication.write_sets(&hash);
let (header, bytes) = DataBlock::from_buffer(data, self.compression_level)
.await
@@ -365,9 +364,9 @@ impl BlockManager {
self.system
.rpc_helper()
.try_call_many(
.try_write_many_sets(
&self.endpoint,
&who[..],
&who,
put_block_rpc,
RequestStrategy::with_priority(PRIO_NORMAL | PRIO_SECONDARY)
.with_quorum(self.replication.write_quorum()),
+1 -1
View File
@@ -434,7 +434,7 @@ impl BlockResyncManager {
.rpc_helper()
.try_call_many(
&manager.endpoint,
&need_nodes[..],
&need_nodes,
put_block_message,
RequestStrategy::with_priority(PRIO_BACKGROUND)
.with_quorum(need_nodes.len()),