Esempio n. 1
0
    def _acceptIdentification(self, node, uuid, num_partitions, num_replicas,
                              your_uuid, primary, known_master_list):
        app = self.app
        if primary != app.primary_master_node.getAddress():
            raise PrimaryFailure('unexpected primary uuid')

        if your_uuid != app.uuid:
            app.uuid = your_uuid
            logging.info('My UUID: ' + uuid_str(your_uuid))

        node.setUUID(uuid)
Esempio n. 2
0
 def connectionLost(self, conn, new_state):
     if self.app.app.listening_conn:  # if running
         raise PrimaryFailure('connection lost')
Esempio n. 3
0
 def reelectPrimary(self, conn):
     raise PrimaryFailure('re-election occurs')
Esempio n. 4
0
 def _connectionLost(self, conn):
     node = self.app.primary_master
     # node is None when switching to primary role
     if node and not node.isConnected(True):
         raise PrimaryFailure('primary master is dead')