From: Samuel Just Date: Tue, 17 Mar 2015 17:07:03 +0000 (-0700) Subject: PGLog::merge_log: in tail extend case, log.log might be empty X-Git-Tag: v0.80.10~24^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73cbb6f34a5a556dbbd4db2e6f81391d83447efd;p=ceph.git PGLog::merge_log: in tail extend case, log.log might be empty 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 (cherry picked from commit f5a2aef3db29b99634250fd388a0c2d9b9a23d38) --- diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index f87b6c9f6c6..a6b2cb53427 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -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::iterator from = olog.log.begin(); list::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);