osd: add osd_debug_no_{acting_change,purge_strays}

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-03-11 17:09:52 -05:00
parent 29ec97d915
commit 8d424ba7c9
3 changed files with 19 additions and 8 deletions

View 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

View 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(""),

View 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;