diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index ebdacaf6901..4a3c88360bf 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1998,6 +1998,14 @@ bool DaemonServer::handle_command(MCommand *m) } return true; } else { + if (!pgmap_ready) { + ss << "Warning: due to ceph-mgr restart, some PG states may not be up to date\n"; + } + if (f) { + f->open_object_section("pg_info"); + f->dump_bool("pg_ready", pgmap_ready); + } + // fall back to feeding command to PGMap r = cluster_state.with_pgmap([&](const PGMap& pg_map) { return cluster_state.with_osdmap([&](const OSDMap& osdmap) { @@ -2006,6 +2014,10 @@ bool DaemonServer::handle_command(MCommand *m) }); }); + if (f) { + f->close_section(); + f->flush(cmdctx->odata); + } if (r != -EOPNOTSUPP) { cmdctx->reply(r, ss); return true;