Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: core: mon/OSDMonitor: trim not-longer-exist failure reporters #30903

Merged
merged 1 commit into from Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/mon/OSDMonitor.cc
Expand Up @@ -576,7 +576,6 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)

share_map_with_random_osd();
update_logger();

process_failures();

// make sure our feature bits reflect the latest map
Expand Down Expand Up @@ -2503,23 +2502,27 @@ bool OSDMonitor::check_failure(utime_t now, int target_osd, failure_info_t& fi)
// help us localize the grace correction to a subset of the system
// (say, a rack with a bad switch) that is unhappy.
assert(fi.reporters.size());
for (map<int,failure_reporter_t>::iterator p = fi.reporters.begin();
p != fi.reporters.end();
++p) {
for (auto p = fi.reporters.begin(); p != fi.reporters.end();) {
// get the parent bucket whose type matches with "reporter_subtree_level".
// fall back to OSD if the level doesn't exist.
map<string, string> reporter_loc = osdmap.crush->get_full_location(p->first);
map<string, string>::iterator iter = reporter_loc.find(reporter_subtree_level);
if (iter == reporter_loc.end()) {
reporters_by_subtree.insert("osd." + to_string(p->first));
if (osdmap.exists(p->first)) {
auto reporter_loc = osdmap.crush->get_full_location(p->first);
if (auto iter = reporter_loc.find(reporter_subtree_level);
iter == reporter_loc.end()) {
reporters_by_subtree.insert("osd." + to_string(p->first));
} else {
reporters_by_subtree.insert(iter->second);
}
if (g_conf->mon_osd_adjust_heartbeat_grace) {
const osd_xinfo_t& xi = osdmap.get_xinfo(p->first);
utime_t elapsed = now - xi.down_stamp;
double decay = exp((double)elapsed * decay_k);
peer_grace += decay * (double)xi.laggy_interval * xi.laggy_probability;
}
++p;
} else {
reporters_by_subtree.insert(iter->second);
}
if (g_conf->mon_osd_adjust_heartbeat_grace) {
const osd_xinfo_t& xi = osdmap.get_xinfo(p->first);
utime_t elapsed = now - xi.down_stamp;
double decay = exp((double)elapsed * decay_k);
peer_grace += decay * (double)xi.laggy_interval * xi.laggy_probability;
fi.cancel_report(p->first);;
p = fi.reporters.erase(p);
}
}

Expand Down