Ensure migration out occurs
This commit is contained in:
parent
77db36a891
commit
47cf0a8006
|
@ -551,8 +551,8 @@ def cleanup():
|
||||||
'/nodes/{}/routerstate'.format(myhostname): 'secondary',
|
'/nodes/{}/routerstate'.format(myhostname): 'secondary',
|
||||||
'/primary_node': 'none'
|
'/primary_node': 'none'
|
||||||
})
|
})
|
||||||
logger.out('Waiting 3 seconds for primary migration', state='s')
|
logger.out('Waiting 5 seconds for primary migration', state='s')
|
||||||
time.sleep(3)
|
time.sleep(5)
|
||||||
|
|
||||||
# Set stop state in Zookeeper
|
# Set stop state in Zookeeper
|
||||||
zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'stop' })
|
zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'stop' })
|
||||||
|
|
|
@ -123,7 +123,7 @@ class NodeInstance(object):
|
||||||
transition_thread.start()
|
transition_thread.start()
|
||||||
else:
|
else:
|
||||||
# Skip becoming secondary unless already running
|
# Skip becoming secondary unless already running
|
||||||
if self.daemon_state == 'run' or self.daemon_state = 'shutdown':
|
if self.daemon_state == 'run' or self.daemon_state == 'shutdown':
|
||||||
self.logger.out('Setting node {} to secondary state'.format(self.name), state='i')
|
self.logger.out('Setting node {} to secondary state'.format(self.name), state='i')
|
||||||
transition_thread = threading.Thread(target=self.become_secondary, args=(), kwargs={})
|
transition_thread = threading.Thread(target=self.become_secondary, args=(), kwargs={})
|
||||||
transition_thread.start()
|
transition_thread.start()
|
||||||
|
|
Loading…
Reference in New Issue