Properly handle takeover state in VXNetworks
Most of these actions/conditionals were looking for primary state, but were failing during node takeover. Update the conditionals to look for both router states instead. Also add a wait to lock flushing until a takeover is completed.
This commit is contained in:
@ -74,6 +74,9 @@ def run_command(zk_conn, logger, this_node, data):
|
||||
# Flushing VM RBD locks
|
||||
if command == 'flush_locks':
|
||||
dom_uuid = args
|
||||
# If this node is taking over primary state, wait until it's done
|
||||
while this_node.router_state == 'takeover':
|
||||
time.sleep(1)
|
||||
if this_node.router_state == 'primary':
|
||||
# Lock the command queue
|
||||
zk_lock = zkhandler.writelock(zk_conn, '/cmd/domains')
|
||||
|
Reference in New Issue
Block a user