* refs/pull/39832/head:
mgr/DaemonServer: osd ok-to-stop: return json when there are unknown PGs
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sebastian Wagner <swagner@suse.com>
f->dump_object("ok_to_stop", out_report);
f->flush(cmdctx->odata);
cmdctx->odata.append("\n");
+ if (!out_report.unknown.empty()) {
+ ss << out_report.unknown.size() << " pgs have unknown state; "
+ << "cannot draw any conclusions";
+ cmdctx->reply(-EAGAIN, ss);
+ }
if (!out_report.ok_to_stop()) {
- ss << "unsafe to stop osd(s)";
+ ss << "unsafe to stop osd(s) at this time (" << out_report.not_ok.size() << " PGs are or would become offline)";
cmdctx->reply(-EBUSY, ss);
} else {
cmdctx->reply(0, ss);