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

jewel: mon: osdmonitor: decouple adjust_heartbeat_grace and min_down_reporters #10757

Merged
1 commit merged into from Oct 24, 2016
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
45 changes: 25 additions & 20 deletions src/mon/OSDMonitor.cc
Expand Up @@ -1726,9 +1726,10 @@ bool OSDMonitor::check_failure(utime_t now, int target_osd, failure_info_t& fi)

utime_t grace = orig_grace;
double my_grace = 0, peer_grace = 0;
double decay_k = 0;
if (g_conf->mon_osd_adjust_heartbeat_grace) {
double halflife = (double)g_conf->mon_osd_laggy_halflife;
double decay_k = ::log(.5) / halflife;
decay_k = ::log(.5) / halflife;

// scale grace period based on historical probability of 'lagginess'
// (false positive failures due to slowness).
Expand All @@ -1738,31 +1739,35 @@ bool OSDMonitor::check_failure(utime_t now, int target_osd, failure_info_t& fi)
<< " failed_for " << failed_for << " decay " << decay << dendl;
my_grace = decay * (double)xi.laggy_interval * xi.laggy_probability;
grace += my_grace;
}

// consider the peers reporting a failure a proxy for a potential
// 'subcluster' over the overall cluster that is similarly
// laggy. this is clearly not true in all cases, but will sometimes
// 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) {
// 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));
} else {
reporters_by_subtree.insert(iter->second);
}

// consider the peers reporting a failure a proxy for a potential
// 'subcluster' over the overall cluster that is similarly
// laggy. this is clearly not true in all cases, but will sometimes
// 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) {
// 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));
} 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;
}
}

if (g_conf->mon_osd_adjust_heartbeat_grace) {
peer_grace /= (double)fi.reporters.size();
grace += peer_grace;
}
Expand Down