]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PG: skip rollforward when !transaction_applied during append_log()
authorNeha Ojha <nojha@redhat.com>
Mon, 4 Mar 2019 04:29:05 +0000 (20:29 -0800)
committerNeha Ojha <nojha@redhat.com>
Fri, 15 Mar 2019 16:48:10 +0000 (09:48 -0700)
Earlier, we did pg_log.roll_forward(&handler), when
!transaction_applied, which advanced the crt and trimmed the entries
in rollforward(). Due to this, during _merge_object_divergent_entries(),
when we tried to rollback entries, those objects were not found in the
backend, and thus we hit this bug http://tracker.ceph.com/issues/36739.

With this change, we are advancing the crt value, without deleting the
objects, so that _merge_object_divergent_entries() does not fail
because of deleted objects.

Fixes: http://tracker.ceph.com/issues/36739
Signed-off-by: Neha Ojha <nojha@redhat.com>
src/osd/PG.cc
src/osd/PGLog.h

index 846790040e0a323255717fd0dc072d4f2cdb884d..733534f739c69e932afaeccad359dc61e388bce1 100644 (file)
@@ -3827,8 +3827,13 @@ void PG::append_log(
      /* We must be a backfill peer, so it's ok if we apply
       * out-of-turn since we won't be considered when
       * determining a min possible last_update.
+      *
+      * We skip_rollforward() here, which advances the crt, without
+      * doing an actual rollforward. This avoids cleaning up entries
+      * from the backend and we do not end up in a situation, where the
+      * object is deleted before we can _merge_object_divergent_entries().
       */
-    pg_log.roll_forward(&handler);
+    pg_log.skip_rollforward();
   }
 
   for (vector<pg_log_entry_t>::const_iterator p = logv.begin();
index 70840c5aef147c80dc1e1e80163b4d60f988fb2f..532128ce6ae6576dfa78b00f06cb57b0287f21a0 100644 (file)
@@ -728,6 +728,10 @@ public:
       h);
   }
 
+  void skip_rollforward() {
+    log.skip_can_rollback_to_to_head();
+  }
+
   //////////////////// get or set log & missing ////////////////////
 
   void reset_backfill_claim_log(const pg_log_t &o, LogEntryHandler *h) {