]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: mark down all connections when rank changes
authorSage Weil <sage@newdream.net>
Tue, 22 Nov 2011 18:09:41 +0000 (10:09 -0800)
committerSage Weil <sage@newdream.net>
Tue, 22 Nov 2011 18:09:41 +0000 (10:09 -0800)
The election and some other stuff depend on msg->get_source().num() to get
the peer rank, and that is part of the connection state.  If it changes,
we need to close old connections and open new ones so that we aren't
taken for someone else (like mon.-1).

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/Monitor.cc

index f45b4edc0a0fc90122bf0b94c1fc8c2046d49773..a722a76db4f53f02e4520a77c15e4c1edeb3f99f 100644 (file)
@@ -243,6 +243,9 @@ void Monitor::bootstrap()
     dout(0) << " my rank is now " << newrank << " (was " << rank << ")" << dendl;
     messenger->set_myname(entity_name_t::MON(newrank));
     rank = newrank;
+
+    // reset all connections, or else our peers will think we are someone else.
+    messenger->mark_down_all();
   }
 
   // reset