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