diff options
author | Trinity Pointard <trinity.pointard@gmail.com> | 2021-06-24 01:34:28 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-10-27 10:31:03 +0200 |
commit | 28c015d9ffcb3255295572465654fdca680b1964 (patch) | |
tree | da668e3594cfaf5bc59435127bf1390b94f98aab /src/garage | |
parent | 4e8af1d95645447ee879c9681775c35db1764d58 (diff) | |
download | garage-28c015d9ffcb3255295572465654fdca680b1964.tar.gz garage-28c015d9ffcb3255295572465654fdca680b1964.zip |
add cli parameter to verify local bloc integrity
reuse code for listing local blocks
add disk i/o speed limit on integrity check
Diffstat (limited to 'src/garage')
-rw-r--r-- | src/garage/cli/structs.rs | 7 | ||||
-rw-r--r-- | src/garage/repair.rs | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index f134cd49..588900a3 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -282,6 +282,13 @@ pub enum RepairWhat { /// Only redo the propagation of version deletions to the block ref table (extremely slow) #[structopt(name = "block_refs")] BlockRefs, + /// Verify integrity of all blocks on disc (extremely slow, i/o intensive) + #[structopt(name = "blocks_integrity")] + BlockIntegrity { + /// Limit on i/o speed, in B/s + #[structopt(name = "limit")] + limit: Option<usize>, + }, } #[derive(Serialize, Deserialize, StructOpt, Debug, Clone)] diff --git a/src/garage/repair.rs b/src/garage/repair.rs index 8200f1f0..a67bf2e5 100644 --- a/src/garage/repair.rs +++ b/src/garage/repair.rs @@ -63,6 +63,14 @@ impl Repair { .await?; } + if let Some(RepairWhat::BlockIntegrity { limit }) = opt.what { + info!("Verifying integrity of stored blocks"); + self.garage + .block_manager + .verify_data_store_integrity(&must_exit, limit) + .await?; + } + Ok(()) } |