]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGBackend: add debug option to rewrite digest even if present
authorSamuel Just <sjust@redhat.com>
Fri, 6 Mar 2015 00:31:15 +0000 (16:31 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 13 Mar 2015 22:29:53 +0000 (15:29 -0700)
Related: #11027
Signed-off-by: Samuel Just <sjust@redhat.com>
src/common/config_opts.h
src/osd/PGBackend.cc

index b13eb0982606c9b537ace1fd64a2be1338fa3fcd..b1da85f1ebb5e87bea46d3af80b6ed3f77ec9c6b 100644 (file)
@@ -639,6 +639,7 @@ OPTION(osd_debug_drop_pg_create_probability, OPT_DOUBLE, 0)
 OPTION(osd_debug_drop_pg_create_duration, OPT_INT, 1)
 OPTION(osd_debug_drop_op_probability, OPT_DOUBLE, 0)   // probability of stalling/dropping a client op
 OPTION(osd_debug_op_order, OPT_BOOL, false)
+OPTION(osd_debug_scrub_chance_rewrite_digest, OPT_U64, 0)
 OPTION(osd_debug_verify_snaps_on_info, OPT_BOOL, false)
 OPTION(osd_debug_verify_stray_on_activate, OPT_BOOL, false)
 OPTION(osd_debug_skip_full_check_in_backfill_reservation, OPT_BOOL, false)
index a3f2b89182fb8b502f72263200365ffe69bb99ea..179630dfda26e47b5cb10e7633dacbf168a8f369 100644 (file)
@@ -623,7 +623,10 @@ void PGBackend::be_compare_scrubmaps(
     }
     if (okseed &&
        auth_object.digest_present && auth_object.omap_digest_present &&
-       (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest())) {
+       (!auth_oi.is_data_digest() || !auth_oi.is_omap_digest() ||
+        (g_conf->osd_debug_scrub_chance_rewrite_digest &&
+         (((unsigned)rand() % 100) >
+           g_conf->osd_debug_scrub_chance_rewrite_digest)))) {
       if (!cur_inconsistent.empty() || !cur_missing.empty()) {
        dout(20) << __func__ << " not updating oi digest on "
                 << *k << " since it is inconsistent" << dendl;