From: Samuel Just Date: Mon, 9 Dec 2013 17:09:45 +0000 (-0800) Subject: PGLog: allow for empty pg log in update_range if log_tail == eversion_t() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2982%2Fhead;p=ceph.git PGLog: allow for empty pg log in update_range if log_tail == eversion_t() Signed-off-by: Samuel Just (cherry picked from commit 03c5344f74991ec351cdc8a55f6495d496479091) Fixes: 10168 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index ff20ceb7b4d6..772c5836748c 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -7570,6 +7570,16 @@ void ReplicatedPG::update_range( dout(10) << __func__<< ": bi is current " << dendl; assert(bi->version == info.last_update); } else if (bi->version >= info.log_tail) { + if (pg_log.get_log().empty()) { + /* Because we don't move log_tail on split, the log might be + * empty even if log_tail != last_update. However, the only + * way to get here with an empty log is if log_tail is actually + * eversion_t(), because otherwise the entry which changed + * last_update since the last scan would have to be present. + */ + assert(bi->version == eversion_t()); + return; + } assert(!pg_log.get_log().empty()); dout(10) << __func__<< ": bi is old, (" << bi->version << ") can be updated with log" << dendl;