Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: Add config option to disable new scrubs during recovery #11874

Merged
merged 1 commit into from Nov 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
13 changes: 13 additions & 0 deletions src/osd/OSD.cc
Expand Up @@ -6576,6 +6576,11 @@ void OSD::sched_scrub()
break;
}

if (!cct->_conf->osd_scrub_during_recovery && service.is_recovery_active()) {
dout(10) << __func__ << "not scheduling scrub of " << scrub.pgid << " due to active recovery ops" << dendl;
break;
}

PG *pg = _lookup_lock_pg(scrub.pgid);
if (!pg)
continue;
Expand Down Expand Up @@ -8552,6 +8557,14 @@ void OSDService::finish_recovery_op(PG *pg, const hobject_t& soid, bool dequeue)
_maybe_queue_recovery();
}

bool OSDService::is_recovery_active()
{
if (recovery_ops_active > 0)
return true;

return false;
}

// =========================================================
// OPS

Expand Down
1 change: 1 addition & 0 deletions src/osd/OSD.h
Expand Up @@ -944,6 +944,7 @@ class OSDService {
public:
void start_recovery_op(PG *pg, const hobject_t& soid);
void finish_recovery_op(PG *pg, const hobject_t& soid, bool dequeue);
bool is_recovery_active();
void release_reserved_pushes(uint64_t pushes) {
Mutex::Locker l(recovery_lock);
assert(recovery_ops_reserved >= pushes);
Expand Down