From 62c75ef633a7347a9d964cb2ae2adc40a7038a15 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 9 Dec 2013 09:09:45 -0800 Subject: [PATCH] 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 --- src/osd/ReplicatedPG.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index ff20ceb7b4d..772c5836748 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; -- 2.47.3