mon: do not forward other mon's requests to other mons

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>
This commit is contained in:
Sage Weil 2013-04-25 16:47:15 -07:00
parent 3ce35a6743
commit 2146930ef0

View File

@ -2766,6 +2766,9 @@ void Monitor::forward_request_leader(PaxosServiceMessage *req)
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;