Skip to content

Commit

Permalink
Monitor: forward report command to leader
Browse files Browse the repository at this point in the history
The `ceph report` section on `osdmap_clean_epochs` is empty if a peon
responds. Forward this command to the leader.

Fixes: https://tracker.ceph.com/issues/47273
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
(cherry picked from commit ae04ea5)
  • Loading branch information
dvanders authored and k0ste committed Apr 27, 2023
1 parent 75ec7d6 commit 8a1b190
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/mon/Monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3692,7 +3692,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"));
Expand Down

0 comments on commit 8a1b190

Please sign in to comment.