From: Mingxin Liu Date: Fri, 13 Jan 2017 07:12:34 +0000 (+0800) Subject: OSDMonitor: drop report message from all another reporters is not reasonable X-Git-Tag: v12.0.0~117^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=29e0b526a2c1807fb898bef1c9f1524e889a80ec;p=ceph.git OSDMonitor: drop report message from all another reporters is not reasonable if osd failed finally, this may make these reporters cannot receive lastest update right away, besides, it's not effective to make a traverse of all reporters Signed-off-by: Mingxin Liu --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 6194c5ba33203..aa27215ed1c83 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1789,13 +1789,9 @@ bool OSDMonitor::prepare_failure(MonOpRequestRef op) << m->get_orig_source_inst() << "\n"; if (failure_info.count(target_osd)) { failure_info_t& fi = failure_info[target_osd]; - list ls; - fi.take_report_messages(ls); - fi.cancel_report(reporter); - while (!ls.empty()) { - if (ls.front()) - mon->no_reply(ls.front()); - ls.pop_front(); + MonOpRequestRef report_op = fi.cancel_report(reporter); + if (report_op) { + mon->no_reply(report_op); } if (fi.reporters.empty()) { dout(10) << " removing last failure_info for osd." << target_osd diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 612870ec72cf8..e5e366684b8ec 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -99,13 +99,13 @@ struct failure_info_t { } } - void cancel_report(int who) { + MonOpRequestRef cancel_report(int who) { map::iterator p = reporters.find(who); if (p == reporters.end()) - return; + return MonOpRequestRef(); + MonOpRequestRef ret = p->second.op; reporters.erase(p); - if (reporters.empty()) - max_failed_since = utime_t(); + return ret; } };