diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-03 13:35:02 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-03 13:35:02 +0200 |
commit | 3d18c9e183a1062d797a9cf1a9a6e3b1e6ae7853 (patch) | |
tree | 318758227940177142a936c6eabecc9296d87830 | |
parent | 9bb58638f044722b58c7a88711fa474152d716b6 (diff) | |
download | garage-3d18c9e183a1062d797a9cf1a9a6e3b1e6ae7853.tar.gz garage-3d18c9e183a1062d797a9cf1a9a6e3b1e6ae7853.zip |
whoops
-rw-r--r-- | src/db/sqlite_adapter.rs | 1 | ||||
-rw-r--r-- | src/garage/repair.rs | 18 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs index ab7efbf8..4f79b34b 100644 --- a/src/db/sqlite_adapter.rs +++ b/src/db/sqlite_adapter.rs @@ -363,6 +363,7 @@ impl<'a> DbValueIterator<'a> { _pin: PhantomPinned, }; let mut boxed = Box::pin(res); + trace!("make iterator with sql: {}", sql); unsafe { let db = NonNull::from(&boxed.db); diff --git a/src/garage/repair.rs b/src/garage/repair.rs index a90b4148..cdcfc90f 100644 --- a/src/garage/repair.rs +++ b/src/garage/repair.rs @@ -64,8 +64,9 @@ impl Repair { async fn repair_versions(&self, must_exit: &watch::Receiver<bool>) -> Result<(), Error> { let mut pos = vec![]; + let mut i = 0; - while *must_exit.borrow() { + while !*must_exit.borrow() { let item_bytes = { let (k, v) = match self.garage.version_table.data.store.get_gt(pos)? { Some(pair) => pair, @@ -75,6 +76,11 @@ impl Repair { v.into_vec() }; + i += 1; + if i % 1000 == 0 { + info!("repair_versions: {}", i); + } + let version = rmp_serde::decode::from_read_ref::<_, Version>(&item_bytes)?; if version.deleted.get() { continue; @@ -104,13 +110,15 @@ impl Repair { .await?; } } + info!("repair_versions: finished, done {}", i); Ok(()) } async fn repair_block_ref(&self, must_exit: &watch::Receiver<bool>) -> Result<(), Error> { let mut pos = vec![]; + let mut i = 0; - while *must_exit.borrow() { + while !*must_exit.borrow() { let item_bytes = { let (k, v) = match self.garage.block_ref_table.data.store.get_gt(pos)? { Some(pair) => pair, @@ -120,6 +128,11 @@ impl Repair { v.into_vec() }; + i += 1; + if i % 1000 == 0 { + info!("repair_block_ref: {}", i); + } + let block_ref = rmp_serde::decode::from_read_ref::<_, BlockRef>(&item_bytes)?; if block_ref.deleted.get() { continue; @@ -146,6 +159,7 @@ impl Repair { .await?; } } + info!("repair_block_ref: finished, done {}", i); Ok(()) } } |