aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-11 12:10:48 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-11 12:10:48 +0200
commit9526328d386ab6261df416327c2efb0791369339 (patch)
tree00bb58facf74ad6a959acb9c92030f1609aadc7b
parent7f9ba49c7151a0c3c29fbe0b0208b4a1f1dfc1e8 (diff)
downloadgarage-9526328d386ab6261df416327c2efb0791369339.tar.gz
garage-9526328d386ab6261df416327c2efb0791369339.zip
scrub: clear saved checkpoint when canceling scrub
-rw-r--r--src/block/repair.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/block/repair.rs b/src/block/repair.rs
index bd14085f..a464e2b6 100644
--- a/src/block/repair.rs
+++ b/src/block/repair.rs
@@ -372,6 +372,9 @@ impl ScrubWorker {
ScrubWorkerCommand::Cancel => {
self.work = match std::mem::take(&mut self.work) {
ScrubWorkerState::Running { .. } | ScrubWorkerState::Paused { .. } => {
+ if let Err(e) = self.persister.set_with(|x| x.checkpoint = None) {
+ error!("Could not save scrub checkpoint: {}", e);
+ }
ScrubWorkerState::Finished
}
work => {