This will be used to force the MDSMonitor to process a beacon in
MDSMonitor::prepare_beacon.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
3ecb987dde4f82450fb269110dea7f30ae2c2748)
Conflicts:
src/common/options/mds.yaml.in
.set_default(0)
.set_description(""),
+ Option("mds_inject_health_dummy", Option::TYPE_BOOL, Option::LEVEL_DEV)
+ .set_default(false)
+ .set_description(""),
+
Option("mds_inject_traceless_reply_probability", Option::TYPE_FLOAT, Option::LEVEL_DEV)
.set_default(0)
.set_description(""),
#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;