diff options
author | Alex Auvolat <alex@adnab.me> | 2024-02-26 18:34:52 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-02-26 18:35:11 +0100 |
commit | b76c0c102ee07758ecf8ae4dfeef0a9a095c4136 (patch) | |
tree | 0926357ab8255924cbb4c857dd0687c5eadbd223 /src/block/manager.rs | |
parent | babccd2ad39c0a626d82521b2d4128ec6f194814 (diff) | |
download | garage-b76c0c102ee07758ecf8ae4dfeef0a9a095c4136.tar.gz garage-b76c0c102ee07758ecf8ae4dfeef0a9a095c4136.zip |
[refactor-put] add ordering tag to blocks being sent to storage nodes
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 |