From 2b86bf4f4c1be2603368d5031ee7d706056e2d1e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 29 Apr 2014 11:23:58 -0700 Subject: [PATCH] osd: automatically scrub PGs with invalid stats If a PG has recnetly split and has invalid stats, scrub it now, even if it has scrubbed recently. This helps the stats become valid again soon. Fixes: #8147 Signed-off-by: Sage Weil (cherry picked from commit 68b440d66539e820c9ce86a6942c3188be4ee1ec) --- src/common/config_opts.h | 1 + src/osd/PG.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 486aba013f983..99754dbd3e877 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -475,6 +475,7 @@ OPTION(osd_snap_trim_thread_timeout, OPT_INT, 60*60*1) OPTION(osd_snap_trim_sleep, OPT_FLOAT, 0) OPTION(osd_scrub_thread_timeout, OPT_INT, 60) OPTION(osd_scrub_finalize_thread_timeout, OPT_INT, 60*10) +OPTION(osd_scrub_invalid_stats, OPT_BOOL, true) OPTION(osd_remove_thread_timeout, OPT_INT, 60*60) OPTION(osd_command_thread_timeout, OPT_INT, 10*60) OPTION(osd_age, OPT_FLOAT, .8) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 00d650ba30460..be12d7cb87f4d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3027,7 +3027,8 @@ bool PG::sched_scrub() void PG::reg_next_scrub() { - if (scrubber.must_scrub) { + if (scrubber.must_scrub || + (info.stats.stats_invalid && g_conf->osd_scrub_invalid_stats)) { scrubber.scrub_reg_stamp = utime_t(); } else { scrubber.scrub_reg_stamp = info.history.last_scrub_stamp; -- 2.39.5