]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: drop report message from all another reporters is not reasonable
authorMingxin Liu <mingxin@xsky.com>
Fri, 13 Jan 2017 07:12:34 +0000 (15:12 +0800)
committerMingxin Liu <mingxin@xsky.com>
Wed, 18 Jan 2017 11:16:10 +0000 (19:16 +0800)
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 <mingxin@xsky.com>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index 6194c5ba332030b622ed16603a670a81d123cd87..aa27215ed1c83b2b0cb1ec4def0916beaf1d5872 100644 (file)
@@ -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<MonOpRequestRef> 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
index 612870ec72cf87c940409ca9f2023d72074a2c07..e5e366684b8ec67241eadc1ed3d63612cbde43d9 100644 (file)
@@ -99,13 +99,13 @@ struct failure_info_t {
     }
   }
 
-  void cancel_report(int who) {
+  MonOpRequestRef cancel_report(int who) {
     map<int, failure_reporter_t>::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;
   }
 };