]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "osd/PG: remove last_updated_applied, op_applied()"
authorSage Weil <sage@redhat.com>
Fri, 16 Mar 2018 19:02:49 +0000 (14:02 -0500)
committerSage Weil <sage@redhat.com>
Fri, 16 Mar 2018 22:20:29 +0000 (17:20 -0500)
This reverts commit c1c495f09754986772c28c9cc7414609572a385c.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 175bd755dc42a15ddc2f770d62d9ef63039735ec..86d958b4799ed9460949df662ddb0895f706e26b 100644 (file)
@@ -1615,6 +1615,7 @@ void PG::activate(ObjectStore::Transaction& t,
     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();
 
   need_up_thru = false;
@@ -4353,7 +4354,8 @@ void PG::repair_object(
 
 /* replica_scrub
  *
- * Wait for pushes to complete in case of recent recovery. Build a single
+ * Wait for last_update_applied to match msg->scrub_to as above. Wait
+ * for pushes to complete in case of recent recovery. Build a single
  * scrubmap of objects that are in the range [msg->start, msg->end).
  */
 void PG::replica_scrub(
index a167e75bbe0f66d7bc1951f5802d162683c86012..e275f3bd8fa5f2680a14f5ac80028352e9a2db3e 100644 (file)
@@ -827,6 +827,7 @@ protected:
 protected:
   eversion_t  last_update_ondisk;    // last_update that has committed; ONLY DEFINED WHEN is_active()
   eversion_t  last_complete_ondisk;  // last_complete that has committed.
+  eversion_t  last_update_applied;
 
   // entries <= last_rollback_info_trimmed_to_applied have been trimmed
   eversion_t  last_rollback_info_trimmed_to_applied;
index dc194e0372998fe754e79754cacd61cd4b13104d..b5ac56aa28f6ee09d61c2fe522631af18d544701 100644 (file)
@@ -9927,6 +9927,13 @@ void PrimaryLogPG::repop_all_committed(RepGather *repop)
   }
 }
 
+void PrimaryLogPG::op_applied(const eversion_t &applied_version)
+{
+  dout(10) << "op_applied version " << applied_version << dendl;
+  assert(applied_version <= info.last_update);
+  last_update_applied = applied_version;
+}
+
 void PrimaryLogPG::eval_repop(RepGather *repop)
 {
   const MOSDOp *m = NULL;
@@ -10033,6 +10040,7 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx)
     repop->rep_tid,
     ctx->reqid,
     ctx->op);
+  op_applied(ctx->at_version);
 }
 
 PrimaryLogPG::RepGather *PrimaryLogPG::new_repop(
@@ -10227,6 +10235,7 @@ void PrimaryLogPG::submit_log_entries(
        new OnComplete{this, rep_tid, get_osdmap()->get_epoch()});
       int r = osd->store->queue_transaction(ch, std::move(t), NULL);
       assert(r == 0);
+      op_applied(info.last_update);
     });
 }
 
@@ -11202,6 +11211,7 @@ void PrimaryLogPG::do_update_log_missing(OpRequestRef &op)
     std::move(t),
     nullptr);
   assert(tr == 0);
+  op_applied(info.last_update);
 }
 
 void PrimaryLogPG::do_update_log_missing_reply(OpRequestRef &op)
index 90713db5365b45b5c494750d52291e791dd08b54..d46af22543c6709d69ba86f5dfa87a93f1a3dc5c 100644 (file)
@@ -414,6 +414,8 @@ public:
     append_log(logv, trim_to, roll_forward_to, t, transaction_applied);
   }
 
+  void op_applied(const eversion_t &applied_version);  // remove me
+
   bool should_send_op(
     pg_shard_t peer,
     const hobject_t &hoid) override {