summaryrefslogtreecommitdiffstats
path: root/src/mon/Monitor.cc
diff options
context:
space:
mode:
authorYuri Weinstein <yweinste@redhat.com>2022-04-12 00:57:36 +0200
committerGitHub <noreply@github.com>2022-04-12 00:57:36 +0200
commit1b47a14f5521646b927516bb1cbaec1be0281184 (patch)
tree90105bf368eb684e0f6b01ded203642b00217768 /src/mon/Monitor.cc
parentMerge pull request #45599 from amathuria/amathuri-54994-fix (diff)
parentmgr, mon: Keep upto date metadata with mgr for MONs (diff)
downloadceph-1b47a14f5521646b927516bb1cbaec1be0281184.tar.xz
ceph-1b47a14f5521646b927516bb1cbaec1be0281184.zip
Merge pull request #45670 from pdvian/wip-fix-mgr-daemon-state
mgr, mon: Keep upto date metadata with mgr for MONs Reviewed-by: Laura Flores <lflores@redhat.com>
Diffstat (limited to 'src/mon/Monitor.cc')
-rw-r--r--src/mon/Monitor.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
index ca4ccb9fecf..ef7a7008129 100644
--- a/src/mon/Monitor.cc
+++ b/src/mon/Monitor.cc
@@ -2965,6 +2965,19 @@ void Monitor::log_health(
}
}
+void Monitor::update_pending_metadata()
+{
+ Metadata metadata;
+ collect_metadata(&metadata);
+ size_t version_size = mon_metadata[rank]["ceph_version_short"].size();
+ const std::string current_version = mon_metadata[rank]["ceph_version_short"];
+ const std::string pending_version = metadata["ceph_version_short"];
+
+ if (current_version.compare(0, version_size, pending_version) < 0) {
+ mgr_client.update_daemon_metadata("mon", name, metadata);
+ }
+}
+
void Monitor::get_cluster_status(stringstream &ss, Formatter *f,
MonSession *session)
{