Skip to content

Commit ab49ca0

Browse files
committed
osd/scrub: fix 'schedule-deepscrub' test asok command
The existing implementation of the 'schedule-deepscrub' Asok command uses the set_last_deep_scrub_stamp() method to "fake" the last-deep-scrub stamp. Unfortunately, this method also updates the last-scrub stamp (as required for non-test usage). Commit 9f3e18b fixed the comparator used when sorting the scrub targets. An unintended side effect is that following 'schedule-deepscrub' - the shallow target is the one to be scrubbed next, instead of the deep target. Signed-off-by: Ronen Friedman <[email protected]>
1 parent 9272d43 commit ab49ca0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/osd/scrubber/pg_scrubber.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,13 @@ void PgScrubber::on_operator_periodic_cmd(
766766
asok_response_section(f, true, scrub_level, stamp);
767767

768768
if (scrub_level == scrub_level_t::deep) {
769+
const auto saved_shallow_stamp = m_pg->info.history.last_scrub_stamp;
769770
// this call sets both stamps
770771
m_pg->set_last_deep_scrub_stamp(stamp);
772+
// restore the shallow stamp, as otherwise it will be scheduled before
773+
// the deep, failing whatever test code called us (this is a test-only
774+
// interface).
775+
m_pg->set_last_scrub_stamp(saved_shallow_stamp);
771776
} else {
772777
m_pg->set_last_scrub_stamp(stamp);
773778
}

0 commit comments

Comments
 (0)