]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGLog::merge_log: in tail extend case, log.log might be empty 4071/head
authorSamuel Just <sjust@redhat.com>
Tue, 17 Mar 2015 17:07:03 +0000 (10:07 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 17 Mar 2015 17:07:03 +0000 (10:07 -0700)
Even if the tail != last_update, the log might be empty due to split
moving all entries into other logs.

Fixes: 10718
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PGLog.cc

index 4b0d7db545f576490f75126841dc57f12d70dae4..f7cdf6ae6bd0250cd4b76d99f7fa5f3498cee43b 100644 (file)
@@ -551,7 +551,6 @@ void PGLog::merge_log(ObjectStore::Transaction& t,
   //  missing set, as that should already be consistent with our
   //  current log.
   if (olog.tail < log.tail) {
-    mark_dirty_to(log.log.begin()->version); // last clean entry
     dout(10) << "merge_log extending tail to " << olog.tail << dendl;
     list<pg_log_entry_t>::iterator from = olog.log.begin();
     list<pg_log_entry_t>::iterator to;
@@ -564,6 +563,10 @@ void PGLog::merge_log(ObjectStore::Transaction& t,
       dout(15) << *to << dendl;
     }
       
+    if (to == olog.log.end())
+      mark_dirty_to(oinfo.last_update);
+    else
+      mark_dirty_to(to->version);
     // splice into our log.
     log.log.splice(log.log.begin(),
                   olog.log, from, to);