]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: automatically scrub PGs with invalid stats 1738/head
authorSage Weil <sage@inktank.com>
Tue, 29 Apr 2014 18:23:58 +0000 (11:23 -0700)
committerSage Weil <sage@inktank.com>
Tue, 29 Apr 2014 18:23:58 +0000 (11:23 -0700)
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 <sage@inktank.com>
src/common/config_opts.h
src/osd/PG.cc

index a065a772f9b13021ca87ba64fa99e95ac940ca82..c0b6e973efa939bd52c1508782630caec3333831 100644 (file)
@@ -471,6 +471,7 @@ OPTION(osd_recovery_thread_timeout, OPT_INT, 30)
 OPTION(osd_snap_trim_thread_timeout, OPT_INT, 60*60*1)
 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)
index 6deb0998b296658762ce7eedfdace7829c5a5d0a..8eb3c34d457299a15f122f24cb5fde5b60d0c21d 100644 (file)
@@ -3003,7 +3003,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;