Skip to content

Commit

Permalink
Merge pull request #13136 from liewegas/wip-scrub-waitlist
Browse files Browse the repository at this point in the history
osd: use separate waitlist for scrub

Reviewed-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
liewegas committed Feb 1, 2017
2 parents c2e9b65 + 7a803bf commit 4a71a8a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/osd/PG.cc
Expand Up @@ -2215,6 +2215,7 @@ void PG::split_ops(PG *child, unsigned split_bits) {
assert(waiting_for_degraded_object.empty());
assert(waiting_for_ondisk.empty());
assert(waiting_for_active.empty());
assert(waiting_for_scrub.empty());

osd->dequeue_pg(this, &waiting_for_peered);

Expand Down Expand Up @@ -4311,7 +4312,7 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle)
scrubber.run_callbacks();

// requeue the writes from the chunk that just finished
requeue_ops(waiting_for_active);
requeue_ops(waiting_for_scrub);

scrubber.state = PG::Scrubber::WAIT_DIGEST_UPDATES;

Expand Down Expand Up @@ -4361,7 +4362,7 @@ void PG::scrub_clear_state()
if (scrubber.active)
osd->dec_scrubs_active();

requeue_ops(waiting_for_active);
requeue_ops(waiting_for_scrub);

if (scrubber.queue_snap_trim) {
dout(10) << "scrub finished, requeuing snap_trimmer" << dendl;
Expand Down
1 change: 1 addition & 0 deletions src/osd/PG.h
Expand Up @@ -831,6 +831,7 @@ class PG : protected DoutPrefixProvider {

// ops waiting on active (require peered as well)
list<OpRequestRef> waiting_for_active;
list<OpRequestRef> waiting_for_scrub;

list<OpRequestRef> waiting_for_cache_not_full;
list<OpRequestRef> waiting_for_all_missing;
Expand Down
10 changes: 6 additions & 4 deletions src/osd/PrimaryLogPG.cc
Expand Up @@ -1860,7 +1860,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
if (write_ordered &&
scrubber.write_blocked_by_scrub(head, get_sort_bitwise())) {
dout(20) << __func__ << ": waiting for scrub" << dendl;
waiting_for_active.push_back(op);
waiting_for_scrub.push_back(op);
op->mark_delayed("waiting for scrub");
return;
}
Expand Down Expand Up @@ -2882,10 +2882,10 @@ void PrimaryLogPG::promote_object(ObjectContextRef obc,
dout(10) << __func__ << " " << hoid
<< " blocked by scrub" << dendl;
if (op) {
waiting_for_active.push_back(op);
waiting_for_scrub.push_back(op);
op->mark_delayed("waiting for scrub");
dout(10) << __func__ << " " << hoid
<< " placing op in waiting_for_active" << dendl;
<< " placing op in waiting_for_scrub" << dendl;
} else {
dout(10) << __func__ << " " << hoid
<< " no op, dropping on the floor" << dendl;
Expand Down Expand Up @@ -10007,10 +10007,11 @@ void PrimaryLogPG::on_change(ObjectStore::Transaction *t)
// requeue everything in the reverse order they should be
// reexamined.
requeue_ops(waiting_for_peered);
requeue_ops(waiting_for_active);

clear_scrub_reserved();

// requeues waiting_for_active
// requeues waiting_for_scrub
scrub_clear_state();

cancel_copy_ops(is_primary());
Expand Down Expand Up @@ -12346,6 +12347,7 @@ bool PrimaryLogPG::agent_choose_mode(bool restart, OpRequestRef op)
if (op)
requeue_op(op);
requeue_ops(waiting_for_active);
requeue_ops(waiting_for_scrub);
requeue_ops(waiting_for_cache_not_full);
objects_blocked_on_cache_full.clear();
requeued = true;
Expand Down
4 changes: 2 additions & 2 deletions src/osd/PrimaryLogPG.h
Expand Up @@ -824,8 +824,8 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
if (scrubber.write_blocked_by_scrub(
p.first.get_head(),
get_sort_bitwise())) {
waiting_for_active.splice(
waiting_for_active.begin(),
waiting_for_scrub.splice(
waiting_for_scrub.begin(),
p.second,
p.second.begin(),
p.second.end());
Expand Down

0 comments on commit 4a71a8a

Please sign in to comment.