aboutsummaryrefslogtreecommitdiff
path: root/src/table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-17 15:36:16 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-17 15:40:13 +0200
commite41ce4d81528388f043c1c5e6608df45347ea70d (patch)
treeee25f06b6f7da356c53d5f0a8fc8ec9e81d4bb23 /src/table.rs
parent867646093b24a9bb7e4b24a7f2248615c6e03fde (diff)
downloadgarage-e41ce4d81528388f043c1c5e6608df45347ea70d.tar.gz
garage-e41ce4d81528388f043c1c5e6608df45347ea70d.zip
Implement getting missing blocks when RC increases
Issue: RC increases also when the block ref entry is first put by the actual client. At that point the client is probably already sending us the block content, so we don't need to do a get... We should add a delay before the task is added or find something to do.
Diffstat (limited to 'src/table.rs')
-rw-r--r--src/table.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/table.rs b/src/table.rs
index 6b7d1779..6892c9f5 100644
--- a/src/table.rs
+++ b/src/table.rs
@@ -4,9 +4,9 @@ use std::time::Duration;
use async_trait::async_trait;
use futures::stream::*;
-use tokio::sync::RwLock;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
+use tokio::sync::RwLock;
use crate::data::*;
use crate::error::Error;
@@ -316,7 +316,10 @@ impl<F: TableSchema + 'static> Table<F> {
return Ok(rmp_serde::decode::from_read_ref(&rep_by)?);
}
}
- Err(Error::Message(format!("Invalid reply to TableRPC: {:?}", resp)))
+ Err(Error::Message(format!(
+ "Invalid reply to TableRPC: {:?}",
+ resp
+ )))
}
async fn handle(self: &Arc<Self>, msg: TableRPC<F>) -> Result<TableRPC<F>, Error> {
@@ -331,7 +334,9 @@ impl<F: TableSchema + 'static> Table<F> {
}
TableRPC::SyncChecksums(checksums) => {
let syncer = self.syncer.read().await.as_ref().unwrap().clone();
- let differing = syncer.handle_checksum_rpc(&checksums[..], self.system.background.stop_signal.clone()).await?;
+ let differing = syncer
+ .handle_checksum_rpc(&checksums[..], self.system.background.stop_signal.clone())
+ .await?;
Ok(TableRPC::SyncDifferentSet(differing))
}
_ => Err(Error::RPCError(format!("Unexpected table RPC"))),