``mon scrub interval``
-:Description: How often (in seconds) the monitor scrub its store by comparing
+:Description: How often the monitor scrub its store by comparing
the stored checksums with the computed ones of all the stored
- keys.
+ keys. (0 disables it. dangerous, use with care)
-:Type: Integer
-:Default: ``3600*24``
+:Type: Seconds
+:Default: ``1 day``
``mon scrub max keys``
OPTION(mon_data_size_warn, OPT_U64) // issue a warning when the monitor's data store goes over 15GB (in bytes)
OPTION(mon_warn_pg_not_scrubbed_ratio, OPT_FLOAT)
OPTION(mon_warn_pg_not_deep_scrubbed_ratio, OPT_FLOAT)
-OPTION(mon_scrub_interval, OPT_INT) // once a day
OPTION(mon_scrub_timeout, OPT_INT) // let's give it 5 minutes; why not.
OPTION(mon_scrub_max_keys, OPT_INT) // max number of keys to scrub each time
OPTION(mon_scrub_inject_crc_mismatch, OPT_DOUBLE) // probability of injected crc mismatch [0.0, 1.0]
.set_long_description("")
.add_see_also("osd_deep_scrub_interval"),
- Option("mon_scrub_interval", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+ Option("mon_scrub_interval", Option::TYPE_SECS, Option::LEVEL_ADVANCED)
.set_default(1_day)
.add_service("mon")
.set_description("frequency for scrubbing mon database"),
}
if (changed.count("mon_scrub_interval")) {
- int scrub_interval = conf->mon_scrub_interval;
+ auto scrub_interval =
+ conf.get_val<std::chrono::seconds>("mon_scrub_interval");
finisher.queue(new C_MonContext{this, [this, scrub_interval](int) {
std::lock_guard l{lock};
scrub_update_interval(scrub_interval);
scrub_state.reset();
}
-inline void Monitor::scrub_update_interval(int secs)
+inline void Monitor::scrub_update_interval(ceph::timespan interval)
{
// we don't care about changes if we are not the leader.
// changes will be visible if we become the leader.
if (!is_leader())
return;
- dout(1) << __func__ << " new interval = " << secs << dendl;
+ dout(1) << __func__ << " new interval = " << interval << dendl;
// if scrub already in progress, all changes will already be visible during
// the next round. Nothing to do.
if (scrub_event)
scrub_event_cancel();
- if (cct->_conf->mon_scrub_interval <= 0) {
+ auto scrub_interval =
+ cct->_conf.get_val<std::chrono::seconds>("mon_scrub_interval");
+ if (scrub_interval == std::chrono::seconds::zero()) {
dout(1) << __func__ << " scrub event is disabled"
- << " (mon_scrub_interval = " << cct->_conf->mon_scrub_interval
+ << " (mon_scrub_interval = " << scrub_interval
<< ")" << dendl;
return;
}
scrub_event = timer.add_event_after(
- cct->_conf->mon_scrub_interval,
+ scrub_interval,
new C_MonContext{this, [this](int) {
scrub_start();
}});
void scrub_timeout();
void scrub_finish();
void scrub_reset();
- void scrub_update_interval(int secs);
+ void scrub_update_interval(ceph::timespan interval);
Context *scrub_event; ///< periodic event to trigger scrub (leader)
Context *scrub_timeout_event; ///< scrub round timeout (leader)