]> 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)
committerSamuel Just <sam.just@inktank.com>
Wed, 6 Nov 2013 19:02:32 +0000 (11:02 -0800)
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>
src/osd/PG.cc

index e92013abdc73325653141846a6bc9875135100de..8207a675bce4a76f3a1863a1dff3fde697f0cd72 100644 (file)
@@ -2399,13 +2399,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
@@ -4679,19 +4673,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 << ")";
     }
   }