]> 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
authorSamuel Just <sjust@redhat.com>
Tue, 17 Mar 2015 17:07:03 +0000 (10:07 -0700)
committerxinxin shu <xinxin.shu@intel.com>
Wed, 1 Apr 2015 02:01:20 +0000 (10:01 +0800)
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>
(cherry picked from commit f5a2aef3db29b99634250fd388a0c2d9b9a23d38)

src/osd/PGLog.cc

index f87b6c9f6c6815ebb1fb1ea5ad53a7be52bf9003..a6b2cb534270e5a7966bdb63efdf056b8d851a03 100644 (file)
@@ -557,7 +557,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;
@@ -570,6 +569,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);