]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd rados command: Rename ss_attr_missing/ss_attr_corrupted to snapset_missing/snapse...
authorDavid Zafman <dzafman@redhat.com>
Thu, 15 Mar 2018 21:29:54 +0000 (14:29 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 10 Apr 2018 20:26:08 +0000 (13:26 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
doc/rados/command/list-inconsistent-obj.json
doc/rados/command/list-inconsistent-snap.json
qa/standalone/scrub/osd-scrub-repair.sh
qa/standalone/scrub/osd-scrub-snaps.sh
src/common/scrub_types.cc
src/common/scrub_types.h
src/include/rados/rados_types.hpp
src/osd/PGBackend.cc
src/osd/PrimaryLogPG.cc
src/tools/rados/rados.cc

index ec2ed0fd170261bcad8c25e1fe8e50d58f460907..ba915b118092bea21456e9293bf51f499d9e11f5 100644 (file)
@@ -68,8 +68,8 @@
                 "oi_attr_missing",
                 "oi_attr_corrupted",
                 "obj_size_oi_mismatch",
-                "ss_attr_missing",
-                "ss_attr_corrupted",
+                "snapset_missing",
+                "snapset_corrupted",
                 "hinfo_missing",
                 "hinfo_corrupted"
               ]
                       "oi_attr_missing",
                       "oi_attr_corrupted",
                       "obj_size_oi_mismatch",
-                      "ss_attr_missing",
-                      "ss_attr_corrupted",
+                      "snapset_missing",
+                      "snapset_corrupted",
                       "hinfo_missing",
                       "hinfo_corrupted"
                     ]
index 0da6b0f9b5a5ad8163dc9fb56149e8ca1b5a2466..30416c91b7774e26bd06d176fdf141543a7461e6 100644 (file)
@@ -40,8 +40,8 @@
             "type": "array",
             "items": {
               "enum": [
-                "ss_attr_missing",
-                "ss_attr_corrupted",
+                "snapset_missing",
+                "snapset_corrupted",
                 "oi_attr_missing",
                 "oi_attr_corrupted",
                 "snapset_mismatch",
index e33445c98478974b54f6988b18aa8982df614a2f..592f0da1eae4676832e8b1569914dc20aeb9da85 100755 (executable)
@@ -842,7 +842,7 @@ function TEST_corrupt_scrub_replicated() {
           }
         ],
         "errors": [
-          "ss_attr_missing"
+          "snapset_missing"
         ],
         "osd": 0,
         "primary": false,
@@ -862,7 +862,7 @@ function TEST_corrupt_scrub_replicated() {
           }
         ],
         "errors": [
-          "ss_attr_corrupted"
+          "snapset_corrupted"
         ],
         "osd": 1,
         "primary": true,
@@ -870,8 +870,8 @@ function TEST_corrupt_scrub_replicated() {
       }
       ],
       "union_shard_errors": [
-        "ss_attr_missing",
-        "ss_attr_corrupted"
+        "snapset_missing",
+        "snapset_corrupted"
       ]
     },
     {
@@ -1324,7 +1324,7 @@ EOF
         ],
         "data_digest": "0x2ddbf8f5",
         "errors": [
-          "ss_attr_missing"
+          "snapset_missing"
         ],
         "omap_digest": "0x8b699207",
         "osd": 0,
@@ -1346,7 +1346,7 @@ EOF
         ],
         "data_digest": "0x2ddbf8f5",
         "errors": [
-          "ss_attr_corrupted"
+          "snapset_corrupted"
         ],
         "omap_digest": "0x8b699207",
         "osd": 1,
@@ -1355,8 +1355,8 @@ EOF
       }
       ],
       "union_shard_errors": [
-        "ss_attr_missing",
-        "ss_attr_corrupted"
+        "snapset_missing",
+        "snapset_corrupted"
       ]
     },
     {
index 13bdb05e07838bc3fd3b025ba9a846a12a2adb72..ff0293e5b4fd09631d3887f489835adf29459e01 100755 (executable)
@@ -293,7 +293,7 @@ function TEST_scrub_snaps() {
     },
     {
       "errors": [
-        "ss_attr_corrupted"
+        "snapset_corrupted"
       ],
       "snap": "head",
       "locator": "",
@@ -306,7 +306,7 @@ function TEST_scrub_snaps() {
         4
       ],
       "errors": [
-        "ss_attr_missing",
+        "snapset_missing",
         "extra_clones"
       ],
       "snap": "head",
index fc59c38b8ce78242928083f765b99de7dda59b0f..9198009176110fc1bdad6b67ccccf00c6e1d4f5c 100644 (file)
@@ -185,7 +185,7 @@ void inconsistent_snapset_wrapper::set_headless()
   errors |= inc_snapset_t::HEADLESS_CLONE;
 }
 
-void inconsistent_snapset_wrapper::set_ss_attr_missing()
+void inconsistent_snapset_wrapper::set_snapset_missing()
 {
   errors |= inc_snapset_t::SNAPSET_MISSING;
 }
@@ -195,7 +195,7 @@ void inconsistent_snapset_wrapper::set_oi_attr_missing()
   errors |= inc_snapset_t::OI_MISSING;
 }
 
-void inconsistent_snapset_wrapper::set_ss_attr_corrupted()
+void inconsistent_snapset_wrapper::set_snapset_corrupted()
 {
   errors |= inc_snapset_t::SNAPSET_CORRUPTED;
 }
index 4285c4637e56d8678f95b36d8e09f722dd5c85f5..e7c4ad97c219bbae16c65b8a9598e59906859b5b 100644 (file)
@@ -74,11 +74,11 @@ public:
   void set_oi_attr_corrupted() {
     errors |= err_t::OI_ATTR_CORRUPTED;
   }
-  void set_ss_attr_missing() {
-    errors |= err_t::SS_ATTR_MISSING;
+  void set_snapset_missing() {
+    errors |= err_t::SNAPSET_MISSING;
   }
-  void set_ss_attr_corrupted() {
-    errors |= err_t::SS_ATTR_CORRUPTED;
+  void set_snapset_corrupted() {
+    errors |= err_t::SNAPSET_CORRUPTED;
   }
   void set_obj_size_oi_mismatch() {
     errors |= err_t::OBJ_SIZE_OI_MISMATCH;
@@ -153,9 +153,9 @@ struct inconsistent_snapset_wrapper : public librados::inconsistent_snapset_t {
   void set_headless();
   // soid claims that it is a head or a snapdir, but its SS_ATTR
   // is missing.
-  void set_ss_attr_missing();
+  void set_snapset_missing();
   void set_oi_attr_missing();
-  void set_ss_attr_corrupted();
+  void set_snapset_corrupted();
   void set_oi_attr_corrupted();
   // snapset with missing clone
   void set_clone_missing(snapid_t);
index 7d8d075e1ff93900a3f0afbd92e025316af4f849..f5d89e5f1e67dc5f2869f72d5d87fcae6d4af5ae 100644 (file)
@@ -62,15 +62,17 @@ struct err_t {
     SHARD_EC_SIZE_MISMATCH  = 1 << 13,
     OI_ATTR_MISSING         = 1 << 14,
     OI_ATTR_CORRUPTED       = 1 << 15,
-    SS_ATTR_MISSING         = 1 << 16,
-    SS_ATTR_CORRUPTED       = 1 << 17,
+    SS_ATTR_MISSING         = 1 << 16, // Old
+    SNAPSET_MISSING         = 1 << 16,
+    SS_ATTR_CORRUPTED       = 1 << 17, // Old
+    SNAPSET_CORRUPTED       = 1 << 17,
     OBJ_SIZE_OI_MISMATCH      = 1 << 18,
     HINFO_MISSING         = 1 << 19,
     HINFO_CORRUPTED       = 1 << 20
     // When adding more here add to either SHALLOW_ERRORS or DEEP_ERRORS
   };
   uint64_t errors = 0;
-  static constexpr uint64_t SHALLOW_ERRORS = SHARD_MISSING|SHARD_STAT_ERR|SIZE_MISMATCH_OI|OI_ATTR_MISSING|OI_ATTR_CORRUPTED|SS_ATTR_MISSING|SS_ATTR_CORRUPTED|OBJ_SIZE_OI_MISMATCH|HINFO_MISSING|HINFO_CORRUPTED;
+  static constexpr uint64_t SHALLOW_ERRORS = SHARD_MISSING|SHARD_STAT_ERR|SIZE_MISMATCH_OI|OI_ATTR_MISSING|OI_ATTR_CORRUPTED|SNAPSET_MISSING|SNAPSET_CORRUPTED|OBJ_SIZE_OI_MISMATCH|HINFO_MISSING|HINFO_CORRUPTED;
   static constexpr uint64_t DEEP_ERRORS = SHARD_READ_ERR|DATA_DIGEST_MISMATCH_OI|OMAP_DIGEST_MISMATCH_OI|SHARD_EC_HASH_MISMATCH|SHARD_EC_SIZE_MISMATCH;
   bool has_shard_missing() const {
     return errors & SHARD_MISSING;
@@ -102,12 +104,18 @@ struct err_t {
   bool has_oi_attr_corrupted() const {
     return errors & OI_ATTR_CORRUPTED;
   }
-  bool has_ss_attr_missing() const {
+  bool has_ss_attr_missing() const {   // Compatibility
     return errors & SS_ATTR_MISSING;
   }
-  bool has_ss_attr_corrupted() const {
+  bool has_snapset_missing() const {
+    return errors & SNAPSET_MISSING;
+  }
+  bool has_ss_attr_corrupted() const { // Compatibility
     return errors & SS_ATTR_CORRUPTED;
   }
+  bool has_snapset_corrupted() const {
+    return errors & SNAPSET_CORRUPTED;
+  }
   bool has_shallow_errors() const {
     return errors & SHALLOW_ERRORS;
   }
@@ -232,10 +240,16 @@ struct inconsistent_snapset_t {
   std::vector<snap_t> clones;
   std::vector<snap_t> missing;
 
-  bool ss_attr_missing() const {
+  bool ss_attr_missing() const {     // Compatibility
     return errors & SNAPSET_MISSING;
   }
-  bool ss_attr_corrupted() const {
+  bool snapset_missing() const {
+    return errors & SNAPSET_MISSING;
+  }
+  bool ss_attr_corrupted() const {   // Compatibility
+    return errors & SNAPSET_CORRUPTED;
+  }
+  bool snapset_corrupted() const {
     return errors & SNAPSET_CORRUPTED;
   }
   bool clone_missing() const  {
index dde1f3965d85d014986c4c763b65c744579723b1..ff262c574421fc8dd8c8358c7c25972bf91397e7 100644 (file)
@@ -817,8 +817,8 @@ map<pg_shard_t, ScrubMap *>::const_iterator
     if (obj.is_head()) {
       k = i->second.attrs.find(SS_ATTR);
       if (k == i->second.attrs.end()) {
-       shard_info.set_ss_attr_missing();
-       error_string += " ss_attr_missing";
+       shard_info.set_snapset_missing();
+       error_string += " snapset_missing";
       } else {
         ss_bl.push_back(k->second);
         try {
@@ -832,8 +832,8 @@ map<pg_shard_t, ScrubMap *>::const_iterator
          }
         } catch (...) {
          // invalid snapset, probably corrupt
-         shard_info.set_ss_attr_corrupted();
-         error_string += " ss_attr_corrupted";
+         shard_info.set_snapset_corrupted();
+         error_string += " snapset_corrupted";
         }
       }
     }
index 639944b00188a5f830cfd737a0296b373823234f..911863d4e3ac470bebdae9c65342f8ec0dd0fb87 100644 (file)
@@ -14524,7 +14524,7 @@ void PrimaryLogPG::scrub_snapshot_metadata(
                          << " no '" << SS_ATTR << "' attr";
         ++scrubber.shallow_errors;
        snapset = boost::none;
-       head_error.set_ss_attr_missing();
+       head_error.set_snapset_missing();
       } else {
        bufferlist bl;
        bl.push_back(p->second.attrs[SS_ATTR]);
@@ -14537,7 +14537,7 @@ void PrimaryLogPG::scrub_snapshot_metadata(
           osd->clog->error() << mode << " " << info.pgid << " " << soid
                << " can't decode '" << SS_ATTR << "' attr " << e.what();
          ++scrubber.shallow_errors;
-         head_error.set_ss_attr_corrupted();
+         head_error.set_snapset_corrupted();
         }
       }
 
index a9ebc4efea8b4e309265251e92752f176b032a9b..16e00a48acef7e0516954655726083e426db2607 100644 (file)
@@ -1346,10 +1346,10 @@ static void dump_errors(const err_t &err, Formatter &f, const char *name)
     f.dump_string("error", "oi_attr_corrupted");
   if (err.has_obj_size_oi_mismatch())
     f.dump_string("error", "obj_size_oi_mismatch");
-  if (err.has_ss_attr_missing())
-    f.dump_string("error", "ss_attr_missing");
-  if (err.has_ss_attr_corrupted())
-    f.dump_string("error", "ss_attr_corrupted");
+  if (err.has_snapset_missing())
+    f.dump_string("error", "snapset_missing");
+  if (err.has_snapset_corrupted())
+    f.dump_string("error", "snapset_corrupted");
   if (err.has_hinfo_missing())
     f.dump_string("error", "hinfo_missing");
   if (err.has_hinfo_corrupted())
@@ -1385,7 +1385,7 @@ static void dump_shard(const shard_info_t& shard,
     decode(oi, bliter);  // Can't be corrupted
     f.dump_stream("object_info") << oi;
   }
-  if (!shard.has_ss_attr_missing() && !shard.has_ss_attr_corrupted() &&
+  if (!shard.has_snapset_missing() && !shard.has_snapset_corrupted() &&
       inc.has_snapset_inconsistency()) {
     SnapSet ss;
     bufferlist bl;
@@ -1408,8 +1408,8 @@ static void dump_shard(const shard_info_t& shard,
   if (inc.has_attr_name_mismatch() || inc.has_attr_value_mismatch()
      || inc.union_shards.has_oi_attr_missing()
      || inc.union_shards.has_oi_attr_corrupted()
-     || inc.union_shards.has_ss_attr_missing()
-     || inc.union_shards.has_ss_attr_corrupted()
+     || inc.union_shards.has_snapset_missing()
+     || inc.union_shards.has_snapset_corrupted()
      || inc.union_shards.has_hinfo_missing()
      || inc.union_shards.has_hinfo_corrupted()) {
     f.open_array_section("attrs");
@@ -1510,10 +1510,10 @@ static void dump_inconsistent(const inconsistent_snapset_t& inc,
   dump_object_id(inc.object, f);
 
   f.open_array_section("errors");
-  if (inc.ss_attr_missing())
-    f.dump_string("error", "ss_attr_missing");
-  if (inc.ss_attr_corrupted())
-    f.dump_string("error", "ss_attr_corrupted");
+  if (inc.snapset_missing())
+    f.dump_string("error", "snapset_missing");
+  if (inc.snapset_corrupted())
+    f.dump_string("error", "snapset_corrupted");
   if (inc.oi_attr_missing())
     f.dump_string("error", "oi_attr_missing");
   if (inc.oi_attr_corrupted())