// Recovery options change was attempted without setting
// the 'osd_mclock_override_recovery_settings' option.
// Find the key to remove from the configuration db.
- std::string key;
- if (changed->count("osd_max_backfills")) {
- key = "osd_max_backfills";
- } else if (changed->count("osd_recovery_max_active")) {
- key = "osd_recovery_max_active";
- } else if (changed->count("osd_recovery_max_active_hdd")) {
- key = "osd_recovery_max_active_hdd";
- } else if (changed->count("osd_recovery_max_active_ssd")) {
- key = "osd_recovery_max_active_ssd";
- } else {
- // No key that we are interested in. Return.
- return true;
- }
-
- // Remove the current entry from the configuration if
- // different from its default value.
- auto val = recovery_qos_defaults.find(key);
- if (val != recovery_qos_defaults.end() &&
+ static const std::vector<std::string> osds = {
+ "osd",
+ "osd." + std::to_string(whoami)
+ };
+ auto check_key = [&](const std::string& key) {
+ // Remove the current entry from the configuration if
+ // different from its default value.
+ auto val = recovery_qos_defaults.find(key);
+ if (val != recovery_qos_defaults.end() &&
cct->_conf.get_val<uint64_t>(key) != val->second) {
- static const std::vector<std::string> osds = {
- "osd",
- "osd." + std::to_string(whoami)
- };
-
- for (auto osd : osds) {
- std::string cmd =
- "{"
- "\"prefix\": \"config rm\", "
- "\"who\": \"" + osd + "\", "
- "\"name\": \"" + key + "\""
- "}";
-
- dout(1) << __func__ << " Removing Key: " << key
- << " for " << osd << " from Mon db" << dendl;
- monc->start_mon_command({std::move(cmd)}, {}, nullptr, nullptr, nullptr);
- }
+ for (auto osd : osds) {
+ std::string cmd =
+ "{"
+ "\"prefix\": \"config rm\", "
+ "\"who\": \"" + osd + "\", "
+ "\"name\": \"" + key + "\""
+ "}";
+
+ dout(1) << __func__ << " Removing Key: " << key
+ << " for " << osd << " from Mon db" << dendl;
+ monc->start_mon_command({std::move(cmd)}, {}, nullptr, nullptr, nullptr);
+ }
- // Raise a cluster warning indicating that the changes did not
- // take effect and indicate the reason why.
- clog->warn() << "Change to " << key << " on osd."
- << std::to_string(whoami) << " did not take effect."
- << " Enable osd_mclock_override_recovery_settings before"
- << " setting this option.";
+ // Raise a cluster warning indicating that the changes did not
+ // take effect and indicate the reason why.
+ clog->warn() << "Change to " << key << " on osd."
+ << std::to_string(whoami) << " did not take effect."
+ << " Enable osd_mclock_override_recovery_settings before"
+ << " setting this option.";
+ }
+ };
+ for(auto& k : *changed) {
+ check_key(k);
}
}
} else { // if (changed != nullptr) (osd boot-up)