]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: if we get our own sync_start back, drop it on the floor.
authorGreg Farnum <greg@inktank.com>
Tue, 30 Apr 2013 20:35:53 +0000 (13:35 -0700)
committerGreg Farnum <greg@inktank.com>
Tue, 30 Apr 2013 20:50:40 +0000 (13:50 -0700)
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 <greg@inktank.com>
src/mon/Monitor.cc

index 11cad14979edf600b9a1abc5804925ca76755706..431cb5d239d7962dca57ca0b1a12c5600738df52 100644 (file)
@@ -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;