The request forwarding infrastructure is there for client requests.
However, we (ab)use it for mon's sending MLog messages: LogClient sends an
MLog message to itself, and that is either handled locally (if leader) or
forwarded to the leader.
If that races with an election, we were forwarding an MLog from another mon
to the leader. This is not necessary; the original MLog sender will resend
the request on election_finish() to the latest leader.
The fix is to adjust forward_request_leader() to only forward messages from
a mon if that mon is itself.
This was reproduced while testing the fix for #4748.
Signed-off-by: Sage Weil <sage@inktank.com>
if (req->session_mon >= 0) {
dout(10) << "forward_request won't double fwd request " << *req << dendl;
req->put();
+ } else if (req->get_source().is_mon() && req->get_source_addr() != messenger->get_myaddr()) {
+ dout(10) << "forward_request won't forward (non-local) mon request " << *req << dendl;
+ req->put();
} else if (session && !session->closed) {
RoutedRequest *rr = new RoutedRequest;
rr->tid = ++routed_request_tid;