From: Greg Farnum Date: Tue, 30 Apr 2013 20:35:53 +0000 (-0700) Subject: mon: if we get our own sync_start back, drop it on the floor. X-Git-Tag: v0.61~29^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a39bbdf32e95475fea0abb5758206387d283fdd0;p=ceph.git mon: if we get our own sync_start back, drop it on the floor. We have timeouts that will clean everything up, and this can happen in some cases that we've decided are legitimate. Hopefully we'll be able to do something else later. Signed-off-by: Greg Farnum --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 11cad14979ed..431cb5d239d7 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -773,13 +773,6 @@ void Monitor::handle_sync_start(MMonSync *m) { dout(10) << __func__ << " " << *m << dendl; - /** - * This looks a bit odd, but we've seen cases where sync start messages - * get bounced around and end up at the originator without anybody - * noticing! - */ - assert(m->reply_to != messenger->get_myinst()); - /* If we are not the leader, then some monitor picked us as the point of * entry to the quorum during its synchronization process. Therefore, we * have an obligation of forwarding this message to leader, so the sender @@ -822,6 +815,20 @@ void Monitor::handle_sync_start(MMonSync *m) assert(quorum.empty()); assert(sync_leader.get() != NULL); + /** + * This looks a bit odd, but we've seen cases where sync start messages + * get bounced around and end up at the originator without anybody + * noticing!* If it happens, just drop the message and the timeouts + * will clean everything up -- eventually. + * [*] If a leader gets elected who is too far behind, he'll drop into + * bootstrap and sync, but the person he sends his sync to thinks he's + * still the leader and forwards the reply back. + */ + if (m->reply_to == messenger->get_myinst()) { + m->put(); + return; + } + dout(10) << __func__ << " forward " << *m << " to our sync leader at " << sync_leader->entity << dendl;