]> 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>
Tue, 10 Mar 2020 04:07:13 +0000 (12:07 +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>
(cherry picked from commit e3d3d0501e5095ce557e2e4ccaefc294a7d5c08c)

Conflicts:
src/mgr/Mgr.cc: trivial resolution

src/mgr/Mgr.cc

index ab749b025771308e48bec435c36c772309770032..eb368307e40315404508ce8ef9fa11a09b903a1a 100644 (file)
@@ -108,6 +108,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.first == "mds" || key.first == "mgr" || key.first == "mon") {
           daemon_meta.erase("name");
         } else if (key.first == "osd") {