Commit 31d25515 authored by Grégory Wisniewski's avatar Grégory Wisniewski

When changing a node state, broadcast those changes after the partition table

changes because if the node have to be dropped (set in DOWN state), the
partition table update will contains it's UUID after it was removed from the
storages partition table and they will fails to find the related node.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1229 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 34ab5ea6
......@@ -87,16 +87,6 @@ class AdministrationHandler(MasterHandler):
conn.notify(p)
return
node.setState(state)
p = protocol.noError('state changed')
conn.answer(p, packet.getId())
app.broadcastNodeInformation(node)
# If this is a storage node, ask it to start.
if node.isStorage() and state == RUNNING_STATE \
and self.app.cluster_state == RUNNING:
logging.info("asking sn to start operation")
node_conn.notify(protocol.startOperation())
# modify the partition table if required
if modify_partition_table and node.isStorage():
if state in (DOWN_STATE, TEMPORARILY_DOWN_STATE, HIDDEN_STATE):
......@@ -115,6 +105,17 @@ class AdministrationHandler(MasterHandler):
ptid = app.pt.setNextID()
app.broadcastPartitionChanges(ptid, cell_list)
if node.getState() != state:
node.setState(state)
p = protocol.noError('state changed')
conn.answer(p, packet.getId())
app.broadcastNodeInformation(node)
# If this is a storage node, ask it to start.
if node.isStorage() and state == RUNNING_STATE \
and self.app.cluster_state == RUNNING:
logging.info("asking sn to start operation")
node_conn.notify(protocol.startOperation())
def handleAddPendingNodes(self, conn, packet, uuid_list):
uuids = ', '.join([dump(uuid) for uuid in uuid_list])
logging.debug('Add nodes %s' % uuids)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment