From f5a2aef3db29b99634250fd388a0c2d9b9a23d38 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 17 Mar 2015 10:07:03 -0700 Subject: [PATCH] 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 --- src/osd/PGLog.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osd/PGLog.cc b/src/osd/PGLog.cc index 4b0d7db545f5..f7cdf6ae6bd0 100644 --- a/src/osd/PGLog.cc +++ b/src/osd/PGLog.cc @@ -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::iterator from = olog.log.begin(); list::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); -- 2.47.3