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
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") {