]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add osd_debug_no_{acting_change,purge_strays}
authorSage Weil <sage@redhat.com>
Mon, 11 Mar 2019 22:09:52 +0000 (17:09 -0500)
committerSage Weil <sage@redhat.com>
Mon, 11 Mar 2019 22:09:52 +0000 (17:09 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/legacy_config_opts.h
src/common/options.cc
src/osd/PG.cc

index 2167088687714c0526d3cb2eb31531dda2a7cae0..ce4e1140401b27237a7326ad203a8e7714a7ad81 100644 (file)
@@ -774,6 +774,7 @@ OPTION(osd_debug_skip_full_check_in_recovery, OPT_BOOL)
 OPTION(osd_debug_random_push_read_error, OPT_DOUBLE)
 OPTION(osd_debug_verify_cached_snaps, OPT_BOOL)
 OPTION(osd_debug_deep_scrub_sleep, OPT_FLOAT)
+OPTION(osd_debug_no_acting_change, OPT_BOOL)
 OPTION(osd_enable_op_tracker, OPT_BOOL) // enable/disable OSD op tracking
 OPTION(osd_num_op_tracker_shard, OPT_U32) // The number of shards for holding the ops
 OPTION(osd_op_history_size, OPT_U32)    // Max number of completed ops to track
index 44a83e60ea5394458036794b5d77be8ebd2158e5..8237e003d72bb3445270451b4a592b66c5770d7c 100644 (file)
@@ -3649,6 +3649,11 @@ std::vector<Option> get_global_options() {
     .set_default(0)
     .set_description("Inject an expensive sleep during deep scrub IO to make it easier to induce preemption"),
 
+    Option("osd_debug_no_acting_change", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false),
+    Option("osd_debug_no_purge_strays", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false),
+
     Option("osd_enable_op_tracker", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
     .set_default(true)
     .set_description(""),
index db6b22d90b7f2ec6d50530038ae8059e75f8d75a..f7aeabea198174cb467b0d5dc90240b3706a7d9e 100644 (file)
@@ -1767,14 +1767,16 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id,
             << ", requesting pg_temp change" << dendl;
     want_acting = want;
 
-    if (want_acting == up) {
-      // There can't be any pending backfill if
-      // want is the same as crush map up OSDs.
-      ceph_assert(want_backfill.empty());
-      vector<int> empty;
-      osd->queue_want_pg_temp(info.pgid.pgid, empty);
-    } else
-      osd->queue_want_pg_temp(info.pgid.pgid, want);
+    if (!cct->_conf->osd_debug_no_acting_change) {
+      if (want_acting == up) {
+       // There can't be any pending backfill if
+       // want is the same as crush map up OSDs.
+       ceph_assert(want_backfill.empty());
+       vector<int> empty;
+       osd->queue_want_pg_temp(info.pgid.pgid, empty);
+      } else
+       osd->queue_want_pg_temp(info.pgid.pgid, want);
+    }
     return false;
   }
   want_acting.clear();
@@ -2995,6 +2997,9 @@ void PG::purge_strays()
             << dendl;
     return;
   }
+  if (cct->_conf.get_val<bool>("osd_debug_no_purge_strays")) {
+    return;
+  }
   dout(10) << "purge_strays " << stray_set << dendl;
   
   bool removed = false;