mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-20 01:52:15 +00:00
Implement table gc, currently for block_ref and version only
This commit is contained in:
+2
-6
@@ -18,6 +18,7 @@ use crate::data::*;
|
||||
use crate::replication::*;
|
||||
use crate::schema::*;
|
||||
use crate::sync::*;
|
||||
use crate::gc::*;
|
||||
|
||||
const TABLE_RPC_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
@@ -44,8 +45,6 @@ pub(crate) enum TableRPC<F: TableSchema> {
|
||||
ReadRange(F::P, Option<F::S>, Option<F::Filter>, usize),
|
||||
|
||||
Update(Vec<Arc<ByteBuf>>),
|
||||
|
||||
SyncRPC(SyncRPC),
|
||||
}
|
||||
|
||||
impl<F: TableSchema> RpcMessage for TableRPC<F> {}
|
||||
@@ -76,6 +75,7 @@ where
|
||||
});
|
||||
|
||||
let syncer = TableSyncer::launch(data.clone(), aux.clone(), rpc_server);
|
||||
TableGC::launch(data.clone(), aux.clone(), rpc_server);
|
||||
|
||||
let table = Arc::new(Self {
|
||||
data,
|
||||
@@ -308,10 +308,6 @@ where
|
||||
self.data.update_many(pairs)?;
|
||||
Ok(TableRPC::Ok)
|
||||
}
|
||||
TableRPC::SyncRPC(rpc) => {
|
||||
let response = self.syncer.handle_rpc(rpc).await?;
|
||||
Ok(TableRPC::SyncRPC(response))
|
||||
}
|
||||
_ => Err(Error::BadRPC(format!("Unexpected table RPC"))),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user