]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: automatically scrub PGs with invalid stats
authorSage Weil <sage@inktank.com>
Tue, 29 Apr 2014 18:23:58 +0000 (11:23 -0700)
committerSage Weil <sage@redhat.com>
Tue, 26 Aug 2014 13:39:20 +0000 (06:39 -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>
(cherry picked from commit 68b440d66539e820c9ce86a6942c3188be4ee1ec)

src/common/config_opts.h
src/osd/PG.cc

index 486aba013f983f60951639ca19549850dfc68470..99754dbd3e8773b39d9873a01d470a2a394c2957 100644 (file)
@@ -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)
index 00d650ba3046032b45b0770e2f1740316fa8a0fa..be12d7cb87f4d27fc26cdcefb60e11c7d536bb11 100644 (file)
@@ -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;