From: Mohamad Gebai Date: Mon, 18 Feb 2019 18:45:02 +0000 (-0500) Subject: mon: show no[deep-]scrub flags per pool in the status X-Git-Tag: v14.2.5~184^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0802abe2c1609093459cd88336e94cdfb1044c9a;p=ceph.git mon: show no[deep-]scrub flags per pool in the status Fixes: http://tracker.ceph.com/issues/38029 Signed-off-by: Mohamad Gebai (cherry picked from commit c8154afa7ab28972c3787b4106c931d013a0298e) --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index e32a5bf2caa6..66ad3a02ebb9 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -5543,6 +5543,31 @@ void OSDMap::check_health(health_check_map_t *checks) const } } + std::list 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