diff options
author | Alex <alex@adnab.me> | 2023-04-24 08:29:36 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2023-04-24 08:29:36 +0000 |
commit | 67420705178185503d5ff436e97c67420f205ee3 (patch) | |
tree | 36e7069b7baab5e1102267efc798f35f2bbae7d7 | |
parent | 02b0ba5f44afdbf86bb2c9ec096c56ffe99730ca (diff) | |
parent | fb3bd11dce1f1a9fb8f60b93894300ce4fc72520 (diff) | |
download | garage-67420705178185503d5ff436e97c67420f205ee3.tar.gz garage-67420705178185503d5ff436e97c67420f205ee3.zip |
Merge pull request 'block/repair.rs: Added log entries for scrub start/finish.' (#551) from jpds/garage:scrub-log into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/551
-rw-r--r-- | src/block/repair.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/block/repair.rs b/src/block/repair.rs index 37ccd59a..c89484d9 100644 --- a/src/block/repair.rs +++ b/src/block/repair.rs @@ -281,6 +281,7 @@ impl ScrubWorker { ScrubWorkerCommand::Start => { self.work = match std::mem::take(&mut self.work) { ScrubWorkerState::Finished => { + info!("Scrub worker initializing, now performing datastore scrub"); let iterator = BlockStoreIterator::new(&self.manager); ScrubWorkerState::Running(iterator) } @@ -394,12 +395,21 @@ impl Worker for ScrubWorker { .tranquilizer .tranquilize_worker(self.persister.get_with(|p| p.tranquility))) } else { + let now = now_msec(); + let next_scrub_timestamp = randomize_next_scrub_run_time(now); + self.persister.set_with(|p| { - p.time_last_complete_scrub = now_msec(); - p.time_next_run_scrub = randomize_next_scrub_run_time(now_msec()); + p.time_last_complete_scrub = now; + p.time_next_run_scrub = next_scrub_timestamp; })?; self.work = ScrubWorkerState::Finished; self.tranquilizer.clear(); + + info!( + "Datastore scrub completed, next scrub scheduled for {}", + msec_to_rfc3339(next_scrub_timestamp) + ); + Ok(WorkerState::Idle) } } |