Skip to content

Commit

Permalink
mon/OSDMonitor: allow blocking trim if option is enabled
Browse files Browse the repository at this point in the history
We need to allow blocking osdmap trimming to test osdmap pruning.

Signed-off-by: Joao Eduardo Luis <[email protected]>
  • Loading branch information
jecluis committed Apr 6, 2018
1 parent b64122a commit 029807b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(""),
Expand Down
1 change: 1 addition & 0 deletions src/mon/Monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 029807b

Please sign in to comment.