From 47cf0a8006dbd8f8b359980d7b6cec6395c27eac Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 25 Dec 2019 21:02:46 -0500 Subject: [PATCH] Ensure migration out occurs --- node-daemon/pvcd/Daemon.py | 4 ++-- node-daemon/pvcd/NodeInstance.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node-daemon/pvcd/Daemon.py b/node-daemon/pvcd/Daemon.py index ec213c36..0fe82821 100644 --- a/node-daemon/pvcd/Daemon.py +++ b/node-daemon/pvcd/Daemon.py @@ -551,8 +551,8 @@ def cleanup(): '/nodes/{}/routerstate'.format(myhostname): 'secondary', '/primary_node': 'none' }) - logger.out('Waiting 3 seconds for primary migration', state='s') - time.sleep(3) + logger.out('Waiting 5 seconds for primary migration', state='s') + time.sleep(5) # Set stop state in Zookeeper zkhandler.writedata(zk_conn, { '/nodes/{}/daemonstate'.format(myhostname): 'stop' }) diff --git a/node-daemon/pvcd/NodeInstance.py b/node-daemon/pvcd/NodeInstance.py index 7045c4a6..be40ccc8 100644 --- a/node-daemon/pvcd/NodeInstance.py +++ b/node-daemon/pvcd/NodeInstance.py @@ -123,7 +123,7 @@ class NodeInstance(object): transition_thread.start() else: # 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') transition_thread = threading.Thread(target=self.become_secondary, args=(), kwargs={}) transition_thread.start()