services:
- mds
with_legacy: true
+- name: mds_inject_health_dummy
+ type: bool
+ level: dev
+ default: false
+ services:
+ - mds
# percentage of MDS modify replies to skip sending the client a trace on [0-1]
- name: mds_inject_traceless_reply_probability
type: float
#include "common/dout.h"
+#include "common/likely.h"
#include "common/HeartbeatMap.h"
#include "include/stringify.h"
health.metrics.clear();
+ if (unlikely(g_conf().get_val<bool>("mds_inject_health_dummy"))) {
+ MDSHealthMetric m(MDS_HEALTH_DUMMY, HEALTH_ERR, std::string("dummy"));
+ health.metrics.push_back(m);
+ }
+
// Detect presence of entries in DamageTable
if (!mds->damage_table.empty()) {
MDSHealthMetric m(MDS_HEALTH_DAMAGE, HEALTH_ERR, std::string(
MDS_HEALTH_SLOW_REQUEST,
MDS_HEALTH_CACHE_OVERSIZED,
MDS_HEALTH_SLOW_METADATA_IO,
+ MDS_HEALTH_DUMMY, // not a real health warning, for testing
};
inline const char *mds_metric_name(mds_metric_t m)
case MDS_HEALTH_SLOW_REQUEST: return "MDS_SLOW_REQUEST";
case MDS_HEALTH_CACHE_OVERSIZED: return "MDS_CACHE_OVERSIZED";
case MDS_HEALTH_SLOW_METADATA_IO: return "MDS_SLOW_METADATA_IO";
+ case MDS_HEALTH_DUMMY: return "MDS_DUMMY";
default:
return "???";
}
health.decode(bl_i);
}
for (const auto &metric : health.metrics) {
+ if (metric.type == MDS_HEALTH_DUMMY) {
+ continue;
+ }
const auto rank = info.rank;
health_check_t *check = &new_checks.get_or_add(
mds_metric_name(metric.type),
std::set<mds_metric_t> new_types;
for (const auto &i : new_health) {
+ if (i.type == MDS_HEALTH_DUMMY) {
+ continue;
+ }
new_types.insert(i.type);
}
for (const auto &new_metric: new_health) {
+ if (new_metric.type == MDS_HEALTH_DUMMY) {
+ continue;
+ }
if (old_types.count(new_metric.type) == 0) {
dout(10) << "MDS health message (" << m->get_orig_source()
<< "): " << new_metric.sev << " " << new_metric.message << dendl;