]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: update pg_log missing for async_recovery_targets
authorNeha Ojha <nojha@redhat.com>
Fri, 26 Jan 2018 18:36:21 +0000 (10:36 -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/PG.cc
src/osd/PGBackend.h
src/osd/PGLog.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index f9b291145f7427c0122b0a58021d4b61a4ebf3de..e82d250e00a49ae3a7358339c4b97f3537e132cd 100644 (file)
@@ -458,7 +458,9 @@ void PG::proc_replica_log(
     dout(20) << " after missing " << i->first << " need " << i->second.need
             << " have " << i->second.have << dendl;
   }
+  dout(10) << __func__ << " peer_missing " << peer_missing[from].get_items() << dendl;
   peer_missing[from].claim(omissing);
+  dout(10) << __func__ << " peer_missing after claim" << peer_missing[from].get_items() << dendl;
 }
 
 bool PG::proc_replica_info(
index 26fda688e8ee3ef1c17adeeb6014399f50398279..c0581f5cae2dda2ccb6239ebc6c95efce6b5f8d2 100644 (file)
@@ -166,6 +166,7 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
        const = 0;
 
      virtual const pg_missing_tracker_t &get_local_missing() const = 0;
+     virtual void add_local_next_event(const pg_log_entry_t& e) = 0;
      virtual const map<pg_shard_t, pg_missing_t> &get_shard_missing()
        const = 0;
      virtual boost::optional<const pg_missing_const_i &> maybe_get_shard_missing(
index 1b889ee0aaea2d557d0dd426182454ed42f462a9..f238c0579bf15185918074fced503ddb925a648a 100644 (file)
@@ -663,8 +663,12 @@ public:
 
   const pg_missing_tracker_t& get_missing() const { return missing; }
 
-  void missing_add(const hobject_t& oid, eversion_t need, eversion_t have) {
-    missing.add(oid, need, have, false);
+  void missing_add(const hobject_t& oid, eversion_t need, eversion_t have, bool is_delete=false) {
+    missing.add(oid, need, have, is_delete);
+  }
+
+  void missing_add_next_entry(const pg_log_entry_t& e) {
+    missing.add_next_event(e);
   }
 
   //////////////////// get or set log ////////////////////
index cd4285a63fb1a1b4078fd71cb3bce7a5b01a4983..9310d137b7cd8cfafc8f0a664105ed61bccb1bf3 100644 (file)
@@ -10067,6 +10067,11 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     projected_log.add(entry);
   }
 
+  for (map<pg_shard_t, pg_missing_t>::iterator i = peer_missing.begin();
+           i != peer_missing.end();
+           ++i) {
+    dout(10) << __func__ << " shard " << i->first << " before missing " << (i->second).get_items() << dendl;
+  }
   for (set<pg_shard_t>::iterator i = async_recovery_targets.begin();
        i != async_recovery_targets.end();
        ++i) {
@@ -10076,6 +10081,12 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     }
   }
 
+  for (map<pg_shard_t, pg_missing_t>::iterator i = peer_missing.begin();
+           i != peer_missing.end();
+           ++i) {
+    dout(10) << __func__ << " shard " << i->first << " after add next missing " << (i->second).get_items() << dendl;
+  }
+
   for (set<pg_shard_t>::const_iterator i = acting_recovery_backfill.begin();
        i != acting_recovery_backfill.end();
        ++i) {
index 5d36a3b616a4f05d7e188b890ea690d85bce45e8..2b007058aaf28565a5ef453701a6400f46b740e8 100644 (file)
@@ -355,6 +355,9 @@ public:
   const PGLog &get_log() const override {
     return pg_log;
   }
+  void add_local_next_event(const pg_log_entry_t& e) {
+    pg_log.missing_add_next_entry(e);
+  }
   bool pgb_is_primary() const override {
     return is_primary();
   }
index b9b31bc46d879ccbfc6300b037f55d51154effa4..91a76f77108a6f95f3407278f400080fc92acb98 100644 (file)
@@ -1004,6 +1004,7 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
   // sanity checks
   assert(m->map_epoch >= get_info().history.same_interval_since);
 
+  dout(10) << __func__ << " missing before " << get_parent()->get_log().get_missing().get_items() << dendl;
   parent->maybe_preempt_replica_scrub(soid);
 
   int ackerosd = m->get_source().num();
@@ -1049,6 +1050,19 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
     // collections now.  Otherwise, we do it later on push.
     update_snaps = true;
   }
+
+  pg_missing_tracker_t pmissing = get_parent()->get_local_missing();
+  if (pmissing.is_missing(soid)) {
+    dout(10) << __func__ << " j->second.is_missing(soid) " << pmissing.is_missing(soid) << dendl;
+    for (auto &&e: log) {
+      dout(10) << " add_next_event entry " << e << dendl;
+      get_parent()->add_local_next_event(e);
+      dout(10) << " entry version " << e.version << dendl;
+      dout(10) << " entry prior version " << e.prior_version << dendl;
+      dout(10) << " entry is_delete " << e.is_delete() << dendl;
+    }
+  }
+
   parent->update_stats(m->pg_stats);
   parent->log_operation(
     log,
@@ -1067,6 +1081,7 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
   tls.push_back(std::move(rm->opt));
   parent->queue_transactions(tls, op);
   // op is cleaned up by oncommit/onapply when both are executed
+  dout(10) << __func__ << " missing after" << get_parent()->get_log().get_missing().get_items() << dendl;
 }
 
 void ReplicatedBackend::repop_commit(RepModifyRef rm)