mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-13 15:46:53 +00:00
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.
This commit is contained in:
+8
-3
@@ -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"))),
|
||||
|
||||
Reference in New Issue
Block a user