From 1a4694fddeaed7577c18a99f0e271a6e30996793 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 14 Oct 2013 10:50:03 -0700 Subject: [PATCH] ReplicatedPG: factor out should_send_op Signed-off-by: Samuel Just --- src/osd/PGBackend.h | 4 ++++ src/osd/ReplicatedPG.cc | 5 +---- src/osd/ReplicatedPG.h | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index cb070be7c4dca..f2c67f113d63a 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 8c47321185ec7..332fbdcd067c2 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 47b411acac354..0364827fc0d8e 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. */ -- 2.39.5