]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: modify should_send_op to handle async recovery
authorNeha Ojha <nojha@redhat.com>
Tue, 19 Dec 2017 21:18:25 +0000 (13:18 -0800)
committerNeha Ojha <nojha@redhat.com>
Wed, 14 Mar 2018 22:56:05 +0000 (15:56 -0700)
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index 2fa81d49b65c8c3d62c1a6d4b155b6bbd8edfd0b..8d3c709f67416d2756f55bfa8a5e3afd715b2444 100644 (file)
@@ -525,6 +525,35 @@ void PrimaryLogPG::backfill_add_missing(
   missing_loc.add_missing(oid, v, eversion_t());
 }
 
+bool PrimaryLogPG::should_send_op(
+  pg_shard_t peer,
+  const hobject_t &hoid) {
+  if (peer == get_primary())
+    return true;
+  assert(peer_info.count(peer));
+  bool should_send =
+      hoid.pool != (int64_t)info.pgid.pool() ||
+      hoid <= last_backfill_started ||
+      hoid <= peer_info[peer].last_backfill;
+  if (!should_send) {
+    assert(is_backfill_targets(peer));
+    dout(10) << __func__ << " issue_repop shipping empty opt to osd." << peer
+             << ", object " << hoid
+             << " beyond std::max(last_backfill_started "
+             << ", peer_info[peer].last_backfill "
+             << peer_info[peer].last_backfill << ")" << dendl;
+    return should_send;
+  }
+  if (async_recovery_targets.count(peer) && peer_missing[peer].is_missing(hoid)) {
+    should_send = false;
+    dout(10) << __func__ << " issue_repop shipping empty opt to osd." << peer
+             << ", object " << hoid
+             << " which is pending recovery in async_recovery_targets" << dendl;
+  }
+  return should_send;
+}
+
+
 ConnectionRef PrimaryLogPG::get_con_osd_cluster(
   int peer, epoch_t from_epoch)
 {
index 3443185c8659a09fe75d0ea9f4014310d9430642..2ef95a8c6844d5c8cf9798051b551b6418b368a7 100644 (file)
@@ -416,18 +416,7 @@ public:
 
   bool should_send_op(
     pg_shard_t peer,
-    const hobject_t &hoid) override {
-    if (peer == get_primary())
-      return true;
-    assert(peer_info.count(peer));
-    bool should_send =
-      hoid.pool != (int64_t)info.pgid.pool() ||
-      hoid <= last_backfill_started ||
-      hoid <= peer_info[peer].last_backfill;
-    if (!should_send)
-      assert(is_backfill_targets(peer));
-    return should_send;
-  }
+    const hobject_t &hoid) override;
 
   bool pg_is_undersized() const override {
     return is_undersized();
index 6ed7bbc61ad6b7cb56a38782576128b5a0bceaa1..43782872a6f8a794dd292dd3be91713fef64b7a7 100644 (file)
@@ -907,11 +907,6 @@ Message * ReplicatedBackend::generate_subop(
 
   // ship resulting transaction, log entries, and pg_stats
   if (!parent->should_send_op(peer, soid)) {
-    dout(10) << "issue_repop shipping empty opt to osd." << peer
-            <<", object " << soid
-            << " beyond std::max(last_backfill_started "
-            << ", pinfo.last_backfill "
-            << pinfo.last_backfill << ")" << dendl;
     ObjectStore::Transaction t;
     encode(t, wr->get_data());
   } else {