aboutsummaryrefslogtreecommitdiff
path: root/src/rpc_server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-17 19:16:08 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-17 19:16:08 +0200
commit4abfb75509f216f4d62bc8b18b22eb680eefe2d9 (patch)
treecf70746c4348cd6523ee11679e35c55f28aea7ba /src/rpc_server.rs
parentdb1c4222cefa99c6a4453da13bdb4f206b4b05a5 (diff)
downloadgarage-4abfb75509f216f4d62bc8b18b22eb680eefe2d9.tar.gz
garage-4abfb75509f216f4d62bc8b18b22eb680eefe2d9.zip
Implement sending blocks to nodes that need them
Diffstat (limited to 'src/rpc_server.rs')
-rw-r--r--src/rpc_server.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpc_server.rs b/src/rpc_server.rs
index c473a32d..3410ab97 100644
--- a/src/rpc_server.rs
+++ b/src/rpc_server.rs
@@ -66,6 +66,11 @@ async fn handler(
tokio::spawn(write_fut).await?
}
Message::GetBlock(h) => garage.block_manager.read_block(&h).await,
+ Message::NeedBlockQuery(h) => garage
+ .block_manager
+ .need_block(&h)
+ .await
+ .map(Message::NeedBlockReply),
Message::TableRPC(table, msg) => {
// Same trick for table RPCs than for PutBlock