From: Samuel Just Date: Mon, 14 Oct 2013 17:50:03 +0000 (-0700) Subject: ReplicatedPG: factor out should_send_op X-Git-Tag: v0.78~286^2~34 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1a4694fddeaed7577c18a99f0e271a6e30996793;p=ceph.git ReplicatedPG: factor out should_send_op Signed-off-by: Samuel Just --- diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index cb070be7c4d..f2c67f113d6 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -114,6 +114,10 @@ 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; diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 8c47321185e..332fbdcd067 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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 " diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 47b411acac3..0364827fc0d 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -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. */