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: use separate waitlist for scrub #13136

Merged
merged 1 commit into from Feb 1, 2017
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
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 @@ -1858,7 +1858,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 @@ -2880,10 +2880,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 @@ -10005,10 +10005,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 @@ -12344,6 +12345,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