diff options
author | Alex <alex@adnab.me> | 2024-02-26 17:52:45 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-02-26 17:52:45 +0000 |
commit | 911a83ea7d06143c5a9621f88020ab6c0850ba54 (patch) | |
tree | 26caedf5ef22e6b299d1e2921d7ef854d5d132d6 /src/block/manager.rs | |
parent | 17b55205aa666e78b73d93754574aca83a12193a (diff) | |
parent | b76c0c102ee07758ecf8ae4dfeef0a9a095c4136 (diff) | |
download | garage-911a83ea7d06143c5a9621f88020ab6c0850ba54.tar.gz garage-911a83ea7d06143c5a9621f88020ab6c0850ba54.zip |
Merge pull request 'rewrite read_and_put_block as a series of steps with channels' (#734) from refactor-put into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/734
Diffstat (limited to 'src/block/manager.rs')
-rw-r--r-- | src/block/manager.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/block/manager.rs b/src/block/manager.rs index 817866f6..890ea8b7 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -346,7 +346,12 @@ impl BlockManager { } /// Send block to nodes that should have it - pub async fn rpc_put_block(&self, hash: Hash, data: Bytes) -> Result<(), Error> { + pub async fn rpc_put_block( + &self, + hash: Hash, + data: Bytes, + order_tag: Option<OrderTag>, + ) -> Result<(), Error> { let who = self.replication.write_nodes(&hash); let (header, bytes) = DataBlock::from_buffer(data, self.compression_level) @@ -354,6 +359,11 @@ impl BlockManager { .into_parts(); let put_block_rpc = Req::new(BlockRpc::PutBlock { hash, header })?.with_stream_from_buffer(bytes); + let put_block_rpc = if let Some(tag) = order_tag { + put_block_rpc.with_order_tag(tag) + } else { + put_block_rpc + }; self.system .rpc |