]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: fix operator<<,log_wierdness log bound warning
authorSamuel Just <sam.just@inktank.com>
Wed, 6 Nov 2013 05:48:53 +0000 (21:48 -0800)
committerSage Weil <sage@inktank.com>
Tue, 1 Apr 2014 19:02:27 +0000 (12:02 -0700)
Split may cause holes such that head != tail and yet
log.empty().

Fixes: #6722
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit c6826c1e8a301b2306530c6e5d0f4a3160c4e691)

src/osd/PG.cc

index 77275483d8ea2a1a8f2bfda64510188b6e49df7a..c2c69ba8e991c14b8faa337fbedfd13092a79b74 100644 (file)
@@ -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 << ")";
     }
   }