Skip to content

Commit

Permalink
osd: Add config option to disable new scrubs during recovery
Browse files Browse the repository at this point in the history
A new config option allows for configuring if the OSD will schedule
a new scrub while recovery is active.

When set to false no new scrubs will be initiated by the OSD while
there are recovery threads active on that OSD.

Signed-off-by: Wido den Hollander <wido@42on.com>
  • Loading branch information
wido committed Nov 9, 2016
1 parent 3b16316 commit cf0dd12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -771,6 +771,7 @@ OPTION(osd_max_push_cost, OPT_U64, 8<<20) // max size of push message
OPTION(osd_max_push_objects, OPT_U64, 10) // max objects in single push op
OPTION(osd_recovery_forget_lost_objects, OPT_BOOL, false) // off for now
OPTION(osd_max_scrubs, OPT_INT, 1)
OPTION(osd_scrub_during_recovery, OPT_BOOL, true) // Allow new scrubs to start while recovery is active on the OSD
OPTION(osd_scrub_begin_hour, OPT_INT, 0)
OPTION(osd_scrub_end_hour, OPT_INT, 24)
OPTION(osd_scrub_load_threshold, OPT_FLOAT, 0.5)
Expand Down
4 changes: 3 additions & 1 deletion src/osd/OSD.cc
Expand Up @@ -1053,7 +1053,9 @@ bool OSDService::can_inc_scrubs_pending()
bool can_inc = false;
Mutex::Locker l(sched_scrub_lock);

if (scrubs_pending + scrubs_active < cct->_conf->osd_max_scrubs) {
if (!cct->_conf->osd_scrub_during_recovery && recovery_ops_active > 0) {
dout(20) << __func__ << "not scheduling scrub because recovery is active" << dendl;
} else if (scrubs_pending + scrubs_active < cct->_conf->osd_max_scrubs) {
dout(20) << __func__ << " " << scrubs_pending << " -> " << (scrubs_pending+1)
<< " (max " << cct->_conf->osd_max_scrubs << ", active " << scrubs_active << ")" << dendl;
can_inc = true;
Expand Down

0 comments on commit cf0dd12

Please sign in to comment.