]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: update "hostname" when we already have the daemon state from the same entity
authorKefu Chai <kchai@redhat.com>
Thu, 5 Mar 2020 15:35:46 +0000 (23:35 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 5 Mar 2020 15:49:27 +0000 (23:49 +0800)
there is chance that we reuse the identity of a daemon and deploy the
daemon on a different host. in that case, the existing daemon state
should be updated with the new hostname.

Fixes: https://tracker.ceph.com/issues/44446
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/Mgr.cc

index 80d05ed5301d2de4ed2329a5cd8083a1a92bbf38..da24a24d0bf8d4fa875fba386a63e9ca7e66df61 100644 (file)
@@ -103,6 +103,8 @@ void MetadataUpdate::finish(int r)
       DaemonStatePtr state;
       if (daemon_state.exists(key)) {
         state = daemon_state.get(key);
+        state->hostname = daemon_meta.at("hostname").get_str();
+
         if (key.type == "mds" || key.type == "mgr" || key.type == "mon") {
           daemon_meta.erase("name");
         } else if (key.type == "osd") {