Merge pull request #45042 from dvanders/report_leader

Monitor: forward report command to leader

Reviewed-by: Neha Ojha <nojha@redhat.com>
This commit is contained in:
Yuri Weinstein 2022-03-03 07:47:46 -08:00 committed by GitHub
commit ec371278ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3656,7 +3656,16 @@ void Monitor::handle_command(MonOpRequestRef op)
rs = "";
r = 0;
} else if (prefix == "report") {
// some of the report data is only known by leader, e.g. osdmap_clean_epochs
if (!is_leader() && !is_peon()) {
dout(10) << " waiting for quorum" << dendl;
waitfor_quorum.push_back(new C_RetryMessage(this, op));
return;
}
if (!is_leader()) {
forward_request_leader(op);
return;
}
// this must be formatted, in its current form
if (!f)
f.reset(Formatter::create("json-pretty"));