From fc82b0ae8eab71ef92b1454d147e49c1d6de550b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 6 Dec 2020 16:02:33 +0800 Subject: [PATCH] mon: use TYPE_SEC for mon_scrub_interval * common/legacy_config_opts.h: drop mon_scrub_interval from legacy settings. as this option is not in critical path. so we can afford the overhead of look its value up in the map. * common/options.cc: change mon_scrub_interval's type from TYPE_INT to TYPE_SECS, so we can use human friendly representations like "3 days" when specifying its value * mon/Monitor.cc: adapt to the changes above. * doc/rados: update the doc for "mon scrub interval" accordingly Signed-off-by: Kefu Chai --- doc/rados/configuration/mon-config-ref.rst | 8 ++++---- src/common/legacy_config_opts.h | 1 - src/common/options.cc | 2 +- src/mon/Monitor.cc | 15 +++++++++------ src/mon/Monitor.h | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/doc/rados/configuration/mon-config-ref.rst b/doc/rados/configuration/mon-config-ref.rst index 333b0f9b3a47e..2edbdd0ba2e76 100644 --- a/doc/rados/configuration/mon-config-ref.rst +++ b/doc/rados/configuration/mon-config-ref.rst @@ -1119,12 +1119,12 @@ Miscellaneous ``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`` diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 8539b353bb1f8..162b324fdaa85 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -269,7 +269,6 @@ OPTION(mon_data_avail_warn, OPT_INT) 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] diff --git a/src/common/options.cc b/src/common/options.cc index 1102696a5da5c..367e52ee0dba2 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -1996,7 +1996,7 @@ std::vector