From 46a3c3c0eb1024c107c11cdb7f025aede9c9b079 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 17 Mar 2018 14:50:27 -0500 Subject: [PATCH] osd/PG: wait for pushes and last_update_applied before requesting replica scrub Wait on the primary for the EC backend to finish r/m/w cycles before we ask the replicas to scrub. Otherwise we will wait on the primary but the replicas will scrub immediately and we'll get a mismatched result! Signed-off-by: Sage Weil --- src/osd/PG.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 27bf6473389..368055f8b9e 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -4720,22 +4720,6 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) } } - // ask replicas to scan - scrubber.waiting_on_whom.insert(pg_whoami); - - // request maps from replicas - for (set::iterator i = actingbackfill.begin(); - i != actingbackfill.end(); - ++i) { - if (*i == pg_whoami) continue; - _request_scrub_map(*i, scrubber.subset_last_update, - scrubber.start, scrubber.end, scrubber.deep, - scrubber.preempt_left > 0); - scrubber.waiting_on_whom.insert(*i); - } - dout(10) << __func__ << " waiting_on_whom " << scrubber.waiting_on_whom - << dendl; - scrubber.state = PG::Scrubber::WAIT_PUSHES; break; @@ -4756,6 +4740,22 @@ void PG::chunky_scrub(ThreadPool::TPHandle &handle) break; } + // ask replicas to scan + scrubber.waiting_on_whom.insert(pg_whoami); + + // request maps from replicas + for (set::iterator i = actingbackfill.begin(); + i != actingbackfill.end(); + ++i) { + if (*i == pg_whoami) continue; + _request_scrub_map(*i, scrubber.subset_last_update, + scrubber.start, scrubber.end, scrubber.deep, + scrubber.preempt_left > 0); + scrubber.waiting_on_whom.insert(*i); + } + dout(10) << __func__ << " waiting_on_whom " << scrubber.waiting_on_whom + << dendl; + scrubber.state = PG::Scrubber::BUILD_MAP; scrubber.primary_scrubmap_pos.reset(); break; -- 2.39.5