]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: wait for pushes and last_update_applied before requesting replica scrub
authorSage Weil <sage@redhat.com>
Sat, 17 Mar 2018 19:50:27 +0000 (14:50 -0500)
committerSage Weil <sage@redhat.com>
Sun, 18 Mar 2018 10:33:11 +0000 (05:33 -0500)
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 <sage@redhat.com>
src/osd/PG.cc

index 27bf647338981ae56150b9bd3e4f3dc19d717bae..368055f8b9e8451818cbb133163b134b921caf61 100644 (file)
@@ -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<pg_shard_t>::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<pg_shard_t>::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;