]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: factor out should_send_op
authorSamuel Just <sam.just@inktank.com>
Mon, 14 Oct 2013 17:50:03 +0000 (10:50 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:15 +0000 (14:39 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PGBackend.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index cb070be7c4dca5b57a804026b02f79afd2f1605c..f2c67f113d63aa6684dc534c4165908bc8e5c65f 100644 (file)
      virtual void op_applied_replica(
        const eversion_t &applied_version) = 0;
 
+     virtual bool should_send_op(
+       int peer,
+       const hobject_t &hoid) = 0;
+
      virtual ~Listener() {}
    };
    Listener *parent;
index 8c47321185ec76f72bf89902e91b812df8f60076..332fbdcd067c2e1bc1cbca3d71d84f8812d3de8e 100644 (file)
@@ -5906,10 +5906,7 @@ void ReplicatedPG::issue_repop(RepGather *repop, utime_t now)
     }
 
     // ship resulting transaction, log entries, and pg_stats
-    if (is_backfill_targets(peer) &&
-       soid > MAX(last_backfill_started, pinfo.last_backfill) &&
-        // only skip normal (not temp pool=-1) objects
-       soid.pool == (int64_t)info.pgid.pool()) {
+    if (!should_send_op(peer, soid)) {
       dout(10) << "issue_repop shipping empty opt to osd." << peer
               <<", object " << soid
               << " beyond MAX(last_backfill_started "
index 47b411acac35458154c9c5ef31847ddf34bb5f46..0364827fc0d8efb2568d4d9c4c9f9a8add9dedca 100644 (file)
@@ -326,6 +326,17 @@ public:
   void op_applied_replica(
     const eversion_t &applied_version);
 
+  bool should_send_op(
+    int peer,
+    const hobject_t &hoid) {
+    assert(peer_info.count(peer));
+    bool should_send = hoid.pool != (int64_t)info.pgid.pool() ||
+      hoid <= MAX(last_backfill_started, peer_info[peer].last_backfill);
+    if (!should_send)
+      assert(is_backfill_targets(peer));
+    return should_send;
+  }
+
   /*
    * Capture all object state associated with an in-progress read or write.
    */