OPTION(mon_warn_on_old_mons, OPT_BOOL, true) // should mons set health to WARN if part of quorum is old?
OPTION(mon_warn_on_legacy_crush_tunables, OPT_BOOL, true) // warn if crush tunables are not optimal
OPTION(mon_warn_on_osd_down_out_interval_zero, OPT_BOOL, true) // warn if 'mon_osd_down_out_interval == 0'
+OPTION(mon_warn_on_cache_pools_without_hit_sets, OPT_BOOL, true)
OPTION(mon_min_osdmap_epochs, OPT_INT, 500)
OPTION(mon_max_pgmap_epochs, OPT_INT, 500)
OPTION(mon_max_log_epochs, OPT_INT, 500)
}
}
+ // hit_set-less cache_mode?
+ if (g_conf->mon_warn_on_cache_pools_without_hit_sets) {
+ int problem_cache_pools = 0;
+ for (map<int64_t, pg_pool_t>::const_iterator p = osdmap.pools.begin();
+ p != osdmap.pools.end();
+ ++p) {
+ const pg_pool_t& info = p->second;
+ if (info.cache_mode_requires_hit_set() &&
+ info.hit_set_params.get_type() == HitSet::TYPE_NONE) {
+ ++problem_cache_pools;
+ if (detail) {
+ ostringstream ss;
+ ss << "pool '" << osdmap.get_pool_name(p->first)
+ << "' with cache_mode " << info.get_cache_mode_name()
+ << " needs hit_set_type to be set but it is not";
+ detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ }
+ }
+ if (problem_cache_pools) {
+ ostringstream ss;
+ ss << problem_cache_pools << " cache pools are missing hit_sets";
+ summary.push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ }
+
// Warn if 'mon_osd_down_out_interval' is set to zero.
// Having this option set to zero on the leader acts much like the
// 'noout' flag. It's hard to figure out what's going wrong with clusters
const char *get_cache_mode_name() const {
return get_cache_mode_name(cache_mode);
}
+ bool cache_mode_requires_hit_set() const {
+ switch (cache_mode) {
+ case CACHEMODE_NONE:
+ case CACHEMODE_FORWARD:
+ case CACHEMODE_READONLY:
+ return false;
+ case CACHEMODE_WRITEBACK:
+ case CACHEMODE_READFORWARD:
+ return true;
+ default:
+ assert(0 == "implement me");
+ }
+ }
uint64_t flags; ///< FLAG_*
__u8 type; ///< TYPE_*