Skip to content

Commit

Permalink
Merge pull request ceph#14968 from TsaiJin/wip-lock-pg-when-scrub-ava…
Browse files Browse the repository at this point in the history
…ilable

osd: sched_scrub() lock pg only if all scrubbing conditions are fulfilled

Reviewed-by: Kefu Chai <[email protected]>
Reviewed-by: Pan Liu <[email protected]>
  • Loading branch information
liewegas authored May 8, 2017
2 parents 6152fd9 + 1dc3e4f commit fd61780
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/osd/OSD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7032,11 +7032,16 @@ void OSD::sched_scrub()
break;
}

if ((scrub.deadline >= now) && !(time_permit && load_is_low)) {
dout(10) << __func__ << " not scheduling scrub for " << scrub.pgid << " due to "
<< (!time_permit ? "time not permit" : "high load") << dendl;
continue;
}

PG *pg = _lookup_lock_pg(scrub.pgid);
if (!pg)
continue;
if (pg->get_pgbackend()->scrub_supported() && pg->is_active() &&
(scrub.deadline < now || (time_permit && load_is_low))) {
if (pg->get_pgbackend()->scrub_supported() && pg->is_active()) {
dout(10) << "sched_scrub scrubbing " << scrub.pgid << " at " << scrub.sched_time
<< (pg->scrubber.must_scrub ? ", explicitly requested" :
(load_is_low ? ", load_is_low" : " deadline < now"))
Expand Down

0 comments on commit fd61780

Please sign in to comment.