mon/OSDMonitor: allow blocking trim if option is enabled

We need to allow blocking osdmap trimming to test osdmap pruning.

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
This commit is contained in:
Joao Eduardo Luis 2017-12-04 23:38:31 +00:00
parent b64122ac37
commit 029807b3e9
3 changed files with 18 additions and 0 deletions

View File

@ -1616,6 +1616,14 @@ std::vector<Option> get_global_options() {
"to run on production systems, or would only be relevant while "
"testing or debugging."),
Option("mon_debug_block_osdmap_trim", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description("Block OSDMap trimming while the option is enabled.")
.set_long_description(
"Blocking OSDMap trimming may be quite helpful to easily reproduce "
"states in which the monitor keeps (hundreds of) thousands of "
"osdmaps."),
Option("mon_debug_deprecated_as_obsolete", Option::TYPE_BOOL, Option::LEVEL_DEV)
.set_default(false)
.set_description(""),

View File

@ -456,6 +456,7 @@ const char** Monitor::get_tracked_conf_keys() const
"mon_osdmap_full_prune_txsize",
// debug options - observed, not handled
"mon_debug_extra_checks",
"mon_debug_block_osdmap_trim",
NULL
};
return KEYS;

View File

@ -1510,6 +1510,15 @@ version_t OSDMonitor::get_trim_to() const
return 0;
}
}
if (g_conf->get_val<bool>("mon_debug_block_osdmap_trim")) {
dout(0) << __func__
<< " blocking osdmap trim"
" ('mon_debug_block_osdmap_trim' set to 'true')"
<< dendl;
return 0;
}
{
epoch_t floor = get_min_last_epoch_clean();
dout(10) << " min_last_epoch_clean " << floor << dendl;