From 87be7c70a17492c9e5f06e01722690acec7a2c51 Mon Sep 17 00:00:00 2001 From: kungf Date: Tue, 17 Oct 2017 22:40:43 +0800 Subject: [PATCH] osd: add scrub week day constraint if add week day constraint, we can set scrub permit time more flexible. eg. we can set scurb in Monday-Wednesday 0-12 o'clock according set this parameter: osd_scrub_begin_week_day = 1 osd_scrub_end_week_day = 3 osd_scrub_begin_hour = 0 osd_scrub_end_hour = 12 Signed-off-by: kungf --- src/common/legacy_config_opts.h | 2 ++ src/common/options.cc | 8 ++++++++ src/osd/OSD.cc | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index b8767c3faa5..77666f1e8f7 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -765,6 +765,8 @@ OPTION(osd_max_scrubs, OPT_INT) OPTION(osd_scrub_during_recovery, OPT_BOOL) // Allow new scrubs to start while recovery is active on the OSD OPTION(osd_scrub_begin_hour, OPT_INT) OPTION(osd_scrub_end_hour, OPT_INT) +OPTION(osd_scrub_begin_week_day, OPT_INT) +OPTION(osd_scrub_end_week_day, OPT_INT) OPTION(osd_scrub_load_threshold, OPT_FLOAT) OPTION(osd_scrub_min_interval, OPT_FLOAT) // if load is low OPTION(osd_scrub_max_interval, OPT_FLOAT) // regardless of load diff --git a/src/common/options.cc b/src/common/options.cc index 769c150779e..b800bad8399 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -2479,6 +2479,14 @@ std::vector