]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: pass task_status instead of a message
authorKefu Chai <kchai@redhat.com>
Tue, 14 Jul 2020 09:34:02 +0000 (17:34 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 15 Jul 2020 04:36:33 +0000 (12:36 +0800)
be explicit that the caller is only interested in the task_status

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/DaemonServer.cc
src/mgr/DaemonServer.h

index 302948fc2068a0b8266548a743c5f1f2a83e0de9..a6227db275474284062383128a82ecfa7f38f932 100644 (file)
@@ -548,20 +548,23 @@ bool DaemonServer::handle_close(const ref_t<MMgrClose>& m)
   return true;
 }
 
-void DaemonServer::update_task_status(DaemonKey key, const ref_t<MMgrReport>& m) {
+void DaemonServer::update_task_status(
+  DaemonKey key,
+  const std::map<std::string,std::string>& task_status)
+{
   dout(10) << "got task status from " << key << dendl;
 
   bool service_map_dirty = false;
-  if ((*m->task_status).empty()) {
+  if (task_status.empty()) {
     auto removed = pending_service_map.rm_daemon(key.type, key.name);
     if (removed) {
       service_map_dirty = true;
     }
   } else {
     auto p = pending_service_map.get_daemon(key.type, key.name);
-    if (!map_compare(p.first->task_status, *m->task_status)) {
+    if (!map_compare(p.first->task_status, task_status)) {
       service_map_dirty = true;
-      p.first->task_status = *m->task_status;
+      p.first->task_status = task_status;
     }
   }
 
@@ -664,7 +667,7 @@ bool DaemonServer::handle_report(const ref_t<MMgrReport>& m)
       }
       // update task status
       if (m->task_status) {
-        update_task_status(key, m);
+        update_task_status(key, *m->task_status);
         daemon->last_service_beacon = now;
       }
       if (m->get_connection()->peer_is_osd() || m->get_connection()->peer_is_mon()) {
index 4c8647beeed03f661b1f9eb7774be3470ef38fda..1e8bef75de7002f60f9dc2124d1cf932fe45e537 100644 (file)
@@ -165,7 +165,8 @@ private:
     }
   };
 
-  void update_task_status(DaemonKey key, const ref_t<MMgrReport>& m);
+  void update_task_status(DaemonKey key,
+                         const std::map<std::string,std::string>& task_status);
 
 public:
   int init(uint64_t gid, entity_addrvec_t client_addrs);