]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: discard scrub reply if pg changed
authorSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 16:41:52 +0000 (08:41 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 16:41:52 +0000 (08:41 -0800)
build_scrub_map will bail out if the pg changed.  Discard the result in
that case since the primary will ignore it anyway.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/PG.cc

index bfba1333e118efca7f81aefed7b58bb24edebc20..18d4575e15436c631b7fe0b3a68e129b8e1935be 100644 (file)
@@ -3115,6 +3115,12 @@ void PG::replica_scrub(MOSDRepScrub *msg)
     build_scrub_map(map);
   }
 
+  if (msg->map_epoch < info.history.same_acting_since) {
+    dout(10) << "replica_scrub discarding old replica_scrub result from "
+            << msg->map_epoch << " < " << info.history.same_acting_since << dendl;
+    return;
+  }
+
   vector<OSDOp> scrub(1);
   scrub[0].op.op = CEPH_OSD_OP_SCRUB_MAP;
   sobject_t poid;