]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: show no[deep-]scrub flags per pool in the status
authorMohamad Gebai <mgebai@suse.com>
Mon, 18 Feb 2019 18:45:02 +0000 (13:45 -0500)
committerNathan Cutler <ncutler@suse.com>
Thu, 29 Aug 2019 09:56:24 +0000 (11:56 +0200)
Fixes: http://tracker.ceph.com/issues/38029
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
(cherry picked from commit c8154afa7ab28972c3787b4106c931d013a0298e)

src/osd/OSDMap.cc

index e32a5bf2caa617c8b05ce79b3baa245866e76755..66ad3a02ebb92fb722c2e04b62ffd9eca6f971c7 100644 (file)
@@ -5543,6 +5543,31 @@ void OSDMap::check_health(health_check_map_t *checks) const
     }
   }
 
+  std::list<std::string> scrub_messages;
+  bool noscrub = false, nodeepscrub = false;
+  for (const auto &p : pools) {
+    if (p.second.flags & pg_pool_t::FLAG_NOSCRUB) {
+      ostringstream ss;
+      ss << "Pool " << get_pool_name(p.first) << " has noscrub flag";
+      scrub_messages.push_back(ss.str());
+      noscrub = true;
+    }
+    if (p.second.flags & pg_pool_t::FLAG_NODEEP_SCRUB) {
+      ostringstream ss;
+      ss << "Pool " << get_pool_name(p.first) << " has nodeep-scrub flag";
+      scrub_messages.push_back(ss.str());
+      nodeepscrub = true;
+    }
+  }
+  if (noscrub || nodeepscrub) {
+    string out = "";
+    out += noscrub ? string("noscrub") + (nodeepscrub ? ", " : "") : "";
+    out += nodeepscrub ? "nodeep-scrub" : "";
+    auto& d = checks->add("POOL_SCRUB_FLAGS", HEALTH_OK,
+      "Some pool(s) have the " + out + " flag(s) set");
+    d.detail.splice(d.detail.end(), scrub_messages);
+  }
+
   // OSD_OUT_OF_ORDER_FULL
   {
     // An osd could configure failsafe ratio, to something different