Skip to content

Commit

Permalink
mon: Fix ceph versions command
Browse files Browse the repository at this point in the history
The commit-id d3cca1d has introduced a bug where mgr/osd/mds
version information goes missing during the cluster upgrade.
Collect version information before checking the emptiness
of the map.

Fixes: https://tracker.ceph.com/issues/61453

Signed-off-by: Prashant D <pdhange@redhat.com>
  • Loading branch information
Prashant D committed May 26, 2023
1 parent e05a42f commit 3fbebe3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mon/Monitor.cc
Expand Up @@ -3962,8 +3962,8 @@ void Monitor::handle_command(MonOpRequestRef op)
}
f->close_section();

mgrmon()->count_metadata("ceph_version", &mgr);
if (!mgr.empty()) {
mgrmon()->count_metadata("ceph_version", &mgr);
f->open_object_section("mgr");
for (auto& p : mgr) {
f->dump_int(p.first.c_str(), p.second);
Expand All @@ -3972,8 +3972,8 @@ void Monitor::handle_command(MonOpRequestRef op)
f->close_section();
}

osdmon()->count_metadata("ceph_version", &osd);
if (!osd.empty()) {
osdmon()->count_metadata("ceph_version", &osd);
f->open_object_section("osd");
for (auto& p : osd) {
f->dump_int(p.first.c_str(), p.second);
Expand All @@ -3982,8 +3982,8 @@ void Monitor::handle_command(MonOpRequestRef op)
f->close_section();
}

mdsmon()->count_metadata("ceph_version", &mds);
if (!mds.empty()) {
mdsmon()->count_metadata("ceph_version", &mds);
f->open_object_section("mds");
for (auto& p : mds) {
f->dump_int(p.first.c_str(), p.second);
Expand Down

0 comments on commit 3fbebe3

Please sign in to comment.