aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrinity Pointard <trinity.pointard@gmail.com>2021-05-31 23:31:17 +0200
committerTrinity Pointard <trinity.pointard@gmail.com>2021-05-31 23:31:17 +0200
commite44bec738cb7ac41f7f34079d3ddbe7435a39a7b (patch)
treeec6c049d403f8ef21bc27d172d4c6f78be197762
parentf6f0c6f5151c0cc3da1f0b5345743030c3a62406 (diff)
downloadgarage-e44bec738cb7ac41f7f34079d3ddbe7435a39a7b.tar.gz
garage-e44bec738cb7ac41f7f34079d3ddbe7435a39a7b.zip
fix blocksync not resyncing compressed blocs properlystorage-optimizations
-rw-r--r--src/model/block.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index 60545d20..219c2144 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -599,11 +599,19 @@ impl BlockManager {
Err(_) => continue,
};
let ent_type = data_dir_ent.file_type().await?;
+ let mut iter_name = name.split('.');
+ let name = iter_name
+ .next()
+ .expect("split always contain at least one item");
+ let corrupted = iter_name
+ .last()
+ .map(|ext| ext == "corrupted")
+ .unwrap_or(false);
if name.len() == 2 && hex::decode(&name).is_ok() && ent_type.is_dir() {
self.repair_aux_read_dir_rec(&data_dir_ent.path(), must_exit)
.await?;
- } else if name.len() == 64 {
+ } else if name.len() == 64 && !corrupted {
let hash_bytes = match hex::decode(&name) {
Ok(h) => h,
Err(_) => continue,