aboutsummaryrefslogtreecommitdiff
path: root/src/block
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-11-14 15:40:46 +0100
committerAlex Auvolat <alex@adnab.me>2023-11-14 15:40:46 +0100
commit90e1619b1e9f5d81e59da371f04717f0c4fe5afc (patch)
tree914435938c6134bb959baaa4ffbd4f575730e9c0 /src/block
parent3b361d2959e3d577bdae6f8a5ccb0c9d5526b7ea (diff)
downloadgarage-90e1619b1e9f5d81e59da371f04717f0c4fe5afc.tar.gz
garage-90e1619b1e9f5d81e59da371f04717f0c4fe5afc.zip
table: take into account multiple write sets in inserts
Diffstat (limited to 'src/block')
-rw-r--r--src/block/manager.rs7
-rw-r--r--src/block/resync.rs2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs
index 2bb9c23d..0ca8bc31 100644
--- a/src/block/manager.rs
+++ b/src/block/manager.rs
@@ -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()),
diff --git a/src/block/resync.rs b/src/block/resync.rs
index 122d0142..15f210e4 100644
--- a/src/block/resync.rs
+++ b/src/block/resync.rs
@@ -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()),