aboutsummaryrefslogtreecommitdiff
path: root/src/garage/repair.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-11 18:28:03 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-11 18:28:27 +0100
commit046b649bcc3b147140fc2b0af0e071d3dd1b2c8d (patch)
treef23ea651237ffce9f3aca3a2e7d32c9aab56b450 /src/garage/repair.rs
parent94f3d287742ff90f179f528421c690b00b71a912 (diff)
downloadgarage-046b649bcc3b147140fc2b0af0e071d3dd1b2c8d.tar.gz
garage-046b649bcc3b147140fc2b0af0e071d3dd1b2c8d.zip
(not well tested) use merkle tree for sync
Diffstat (limited to 'src/garage/repair.rs')
-rw-r--r--src/garage/repair.rs33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/garage/repair.rs b/src/garage/repair.rs
index f9cd5884..47fc1ae1 100644
--- a/src/garage/repair.rs
+++ b/src/garage/repair.rs
@@ -25,26 +25,11 @@ impl Repair {
if todo(RepairWhat::Tables) {
info!("Launching a full sync of tables");
- self.garage
- .bucket_table
- .syncer
- .add_full_scan();
- self.garage
- .object_table
- .syncer
- .add_full_scan();
- self.garage
- .version_table
- .syncer
- .add_full_scan();
- self.garage
- .block_ref_table
- .syncer
- .add_full_scan();
- self.garage
- .key_table
- .syncer
- .add_full_scan();
+ self.garage.bucket_table.syncer.add_full_sync();
+ self.garage.object_table.syncer.add_full_sync();
+ self.garage.version_table.syncer.add_full_sync();
+ self.garage.block_ref_table.syncer.add_full_sync();
+ self.garage.key_table.syncer.add_full_sync();
}
// TODO: wait for full sync to finish before proceeding to the rest?
@@ -78,7 +63,9 @@ impl Repair {
async fn repair_versions(&self, must_exit: &watch::Receiver<bool>) -> Result<(), Error> {
let mut pos = vec![];
- while let Some((item_key, item_bytes)) = self.garage.version_table.data.store.get_gt(&pos)? {
+ while let Some((item_key, item_bytes)) =
+ self.garage.version_table.data.store.get_gt(&pos)?
+ {
pos = item_key.to_vec();
let version = rmp_serde::decode::from_read_ref::<_, Version>(item_bytes.as_ref())?;
@@ -126,7 +113,9 @@ impl Repair {
async fn repair_block_ref(&self, must_exit: &watch::Receiver<bool>) -> Result<(), Error> {
let mut pos = vec![];
- while let Some((item_key, item_bytes)) = self.garage.block_ref_table.data.store.get_gt(&pos)? {
+ while let Some((item_key, item_bytes)) =
+ self.garage.block_ref_table.data.store.get_gt(&pos)?
+ {
pos = item_key.to_vec();
let block_ref = rmp_serde::decode::from_read_ref::<_, BlockRef>(item_bytes.as_ref())?;