From: xie xingguo Date: Fri, 20 Sep 2019 07:33:40 +0000 (+0800) Subject: osd/PeeringState: recover_got - add special handler for empty log X-Git-Tag: v15.1.0~1456^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30503%2Fhead;p=ceph.git osd/PeeringState: recover_got - add special handler for empty log If we use a small osd_min[max]_pg_log_entries setting, say, 10, and do splitting, a child pg may only be able to keep some divergent log entries in the list. Any follow-up peering cycle on that child pg would then rewind all the divergent log entries and lead to an empty log list, which as a result could reliably fire the ceph_assert(info.last_complete == info.last_update) assert if we start to recover any of the missing divergent objects later. Fixes: https://tracker.ceph.com/issues/41816 Signed-off-by: xie xingguo --- diff --git a/src/osd/PeeringState.cc b/src/osd/PeeringState.cc index 616cdd72b2ff..a180db783159 100644 --- a/src/osd/PeeringState.cc +++ b/src/osd/PeeringState.cc @@ -3659,7 +3659,10 @@ void PeeringState::recover_got( psdout(10) << "got missing " << oid << " v " << v << dendl; pg_log.recover_got(oid, v, info); - if (pg_log.get_log().complete_to != pg_log.get_log().log.end()) { + if (pg_log.get_log().log.empty()) { + psdout(10) << "last_complete now " << info.last_complete + << " while log is empty" << dendl; + } else if (pg_log.get_log().complete_to != pg_log.get_log().log.end()) { psdout(10) << "last_complete now " << info.last_complete << " log.complete_to " << pg_log.get_log().complete_to->version << dendl;