From: Samuel Just Date: Wed, 6 Nov 2013 05:48:53 +0000 (-0800) Subject: PG: fix operator<<,log_wierdness log bound warning X-Git-Tag: v0.67.8~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=225fc97f228490dfc13c2e4deed8fecffdb28c5e;p=ceph.git PG: fix operator<<,log_wierdness log bound warning Split may cause holes such that head != tail and yet log.empty(). Fixes: #6722 Signed-off-by: Samuel Just Reviewed-by: David Zafman (cherry picked from commit c6826c1e8a301b2306530c6e5d0f4a3160c4e691) --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 77275483d8e..c2c69ba8e99 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2476,13 +2476,7 @@ void PG::log_weirdness() << " != info.last_update " << info.last_update << "\n"; - if (pg_log.get_log().empty()) { - // shoudl it be? - if (pg_log.get_head() != pg_log.get_tail()) - osd->clog.error() << info.pgid - << " log bound mismatch, empty but (" << pg_log.get_tail() << "," - << pg_log.get_head() << "]\n"; - } else { + if (!pg_log.get_log().empty()) { // sloppy check if ((pg_log.get_log().log.begin()->version <= pg_log.get_tail())) osd->clog.error() << info.pgid @@ -4752,19 +4746,11 @@ ostream& operator<<(ostream& out, const PG& pg) pg.pg_log.get_head() != pg.info.last_update) out << " (info mismatch, " << pg.pg_log.get_log() << ")"; - if (pg.pg_log.get_log().empty()) { - // shoudl it be? - if (pg.pg_log.get_head().version - pg.pg_log.get_tail().version != 0) { - out << " (log bound mismatch, empty)"; - } - } else { - if ((pg.pg_log.get_log().log.begin()->version <= pg.pg_log.get_tail()) || // sloppy check - (pg.pg_log.get_log().log.rbegin()->version != pg.pg_log.get_head() && - !(pg.pg_log.get_head() == pg.pg_log.get_tail()))) { + if (!pg.pg_log.get_log().empty()) { + if ((pg.pg_log.get_log().log.begin()->version <= pg.pg_log.get_tail())) { out << " (log bound mismatch, actual=[" << pg.pg_log.get_log().log.begin()->version << "," << pg.pg_log.get_log().log.rbegin()->version << "]"; - //out << "len=" << pg.log.log.size(); out << ")"; } }