From: Sage Weil Date: Thu, 25 Apr 2013 23:47:15 +0000 (-0700) Subject: mon: do not forward other mon's requests to other mons X-Git-Tag: v0.61~89^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2146930ef01dd39fe0426e53360b89fe19382f2c;p=ceph.git 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index ab63ad80d1b7..a26c70fe3b50 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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;