]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/: maintain PeeringState::min_last_complete_ondisk on replica
authorSamuel Just <sjust@redhat.com>
Fri, 13 Dec 2019 21:28:09 +0000 (13:28 -0800)
committerSamuel Just <sjust@redhat.com>
Fri, 20 Dec 2019 01:35:36 +0000 (17:35 -0800)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ECBackend.cc
src/osd/PGBackend.h
src/osd/PeeringState.cc
src/osd/PeeringState.h
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index 27c3dd03223f0f7c75818c59d055f0340eca69c6..9b46de4af6313e45d8250b487a0b39096cd99dbe 100644 (file)
@@ -960,6 +960,7 @@ void ECBackend::handle_sub_write(
     op.updated_hit_set_history,
     op.trim_to,
     op.roll_forward_to,
+    op.roll_forward_to,
     !op.backfill_or_async_recovery,
     localt,
     async);
index 1b4c48fd48cebc2a9f7b05c1390d5e72eec8c57c..734d857bf28c23a88bc7c816ca7660a57ef00528 100644 (file)
@@ -235,6 +235,7 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
        const std::optional<pg_hit_set_history_t> &hset_history,
        const eversion_t &trim_to,
        const eversion_t &roll_forward_to,
+       const eversion_t &min_last_complete_ondisk,
        bool transaction_applied,
        ObjectStore::Transaction &t,
        bool async = false) = 0;
index 2d3450646cb407197f6352591ba71ca34784ee2d..af57ce1b290649d8e9f5a9c5aab9cee63dbf5f57 100644 (file)
@@ -2334,9 +2334,9 @@ void PeeringState::activate(
 
   auto &missing = pg_log.get_missing();
 
+  min_last_complete_ondisk = eversion_t(0,0);  // we don't know (yet)!
   if (is_primary()) {
     last_update_ondisk = info.last_update;
-    min_last_complete_ondisk = eversion_t(0,0);  // we don't know (yet)!
   }
   last_update_applied = info.last_update;
   last_rollback_info_trimmed_to_applied = pg_log.get_can_rollback_to();
@@ -3773,6 +3773,7 @@ void PeeringState::append_log(
   const vector<pg_log_entry_t>& logv,
   eversion_t trim_to,
   eversion_t roll_forward_to,
+  eversion_t mlcod,
   ObjectStore::Transaction &t,
   bool transaction_applied,
   bool async)
@@ -3836,6 +3837,9 @@ void PeeringState::append_log(
   // update the local pg, pg log
   dirty_info = true;
   write_if_dirty(t);
+
+  if (!is_primary())
+    min_last_complete_ondisk = mlcod;
 }
 
 void PeeringState::recover_got(
@@ -6052,6 +6056,8 @@ void PeeringState::ReplicaActive::exit()
   pl->cancel_remote_recovery_reservation();
   utime_t dur = ceph_clock_now() - enter_time;
   pl->get_peering_perf().tinc(rs_replicaactive_latency, dur);
+
+  ps->min_last_complete_ondisk = eversion_t();
 }
 
 /*-------Stray---*/
@@ -7004,9 +7010,7 @@ ostream &operator<<(ostream &out, const PeeringState &ps) {
   if (ps.last_complete_ondisk != ps.info.last_complete)
     out << " lcod " << ps.last_complete_ondisk;
 
-  if (ps.is_primary()) {
-    out << " mlcod " << ps.min_last_complete_ondisk;
-  }
+  out << " mlcod " << ps.min_last_complete_ondisk;
 
   out << " " << pg_state_string(ps.get_state());
   if (ps.should_send_notify())
index cb8d08b2362cf796add8fc38d7da23401ca2d7cf..c67a76881fdc416dd06d7052f2bb225920c62141 100644 (file)
@@ -1770,6 +1770,7 @@ public:
     const vector<pg_log_entry_t>& logv,
     eversion_t trim_to,
     eversion_t roll_forward_to,
+    eversion_t min_last_complete_ondisk,
     ObjectStore::Transaction &t,
     bool transaction_applied,
     bool async);
index 150ac08f26343070abacffb6ac86afb5c8b9b93d..4ca01b2f61ebefce52485902f88674306fedb0bc 100644 (file)
@@ -459,6 +459,7 @@ public:
     const std::optional<pg_hit_set_history_t> &hset_history,
     const eversion_t &trim_to,
     const eversion_t &roll_forward_to,
+    const eversion_t &min_last_complete_ondisk,
     bool transaction_applied,
     ObjectStore::Transaction &t,
     bool async = false) override {
@@ -474,7 +475,8 @@ public:
       projected_log.trim(cct, last->version, nullptr, nullptr, nullptr);
     }
     recovery_state.append_log(
-      logv, trim_to, roll_forward_to, t, transaction_applied, async);
+      logv, trim_to, roll_forward_to, min_last_complete_ondisk,
+      t, transaction_applied, async);
   }
 
   void op_applied(const eversion_t &applied_version) override;
index 2f82da28b9977a57b08ec31870f93259add7be0c..78effa9048283406690099473dcd20547140818d 100644 (file)
@@ -450,7 +450,7 @@ void ReplicatedBackend::submit_transaction(
   const eversion_t &at_version,
   PGTransactionUPtr &&_t,
   const eversion_t &trim_to,
-  const eversion_t &roll_forward_to,
+  const eversion_t &min_last_complete_ondisk,
   const vector<pg_log_entry_t> &_log_entries,
   std::optional<pg_hit_set_history_t> &hset_history,
   Context *on_all_commit,
@@ -514,6 +514,7 @@ void ReplicatedBackend::submit_transaction(
     hset_history,
     trim_to,
     at_version,
+    min_last_complete_ondisk,
     true,
     op_t);
   
@@ -1111,6 +1112,7 @@ void ReplicatedBackend::do_repop(OpRequestRef op)
     m->updated_hit_set_history,
     m->pg_trim_to,
     m->version, /* Replicated PGs don't have rollback info */
+    m->min_last_complete_ondisk,
     update_snaps,
     rm->localt,
     async);