Commit d8db8d56 authored by Grégory Wisniewski's avatar Grégory Wisniewski

The admin node ask the partition table itself, so don't send it anymore.

When a storage node died, leaving the pt in a non-operational state, this now
nicely handled at the connection closure (see previous commit), so it is no more
usefull to check the pt status at temporarily state expiration.
Add an comment to fix a bug just found.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@861 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 378873f2
...@@ -388,6 +388,9 @@ class Application(object): ...@@ -388,6 +388,9 @@ class Application(object):
logging.info('startup allowed') logging.info('startup allowed')
if self.pt.getID() == INVALID_PTID: if self.pt.getID() == INVALID_PTID:
self.buildFromScratch() self.buildFromScratch()
# FIXME: storage node with existing partition but not in the selected PT
# must switch to PENDING state or be disconnected to restarts from nothing
logging.info('cluster starts with this partition table :') logging.info('cluster starts with this partition table :')
self.pt.log() self.pt.log()
...@@ -468,20 +471,6 @@ class Application(object): ...@@ -468,20 +471,6 @@ class Application(object):
logging.info('start to verify data') logging.info('start to verify data')
# FIXME this part has a potential problem that the write buffers can
# be very huge. Thus it would be better to flush the buffers from time
# to time _without_ reading packets.
# Send the current partition table to storage and admin nodes, so that
# all nodes share the same view.
# FIXME: the admin must ask itself the partition table
for conn in em.getConnectionList():
uuid = conn.getUUID()
if uuid is not None:
node = nm.getNodeByUUID(uuid)
if node.getNodeType() == ADMIN_NODE_TYPE:
self.sendPartitionTable(conn)
# Gather all unfinished transactions. # Gather all unfinished transactions.
# #
# FIXME this part requires more brainstorming. Currently, this deals with # FIXME this part requires more brainstorming. Currently, this deals with
...@@ -579,17 +568,10 @@ class Application(object): ...@@ -579,17 +568,10 @@ class Application(object):
and node.getLastStateChange() + expiration < current_time: and node.getLastStateChange() + expiration < current_time:
logging.warning('%s is down, have to notify the admin' % (node, )) logging.warning('%s is down, have to notify the admin' % (node, ))
# XXX: here we should notify the administrator that # XXX: here we should notify the administrator that
# a node seems dead and should be dropped frop the # a node seems dead and should be dropped from the
# partition table. This should not be done # partition table. This should not be done
# automaticaly to avoid data lost. # automaticaly to avoid data lost.
node.setState(DOWN_STATE) node.setState(DOWN_STATE)
#self.broadcastNodeInformation(node)
#cell_list = self.pt.dropNode(node)
#self.broadcastPartitionChanges(self.pt.setNextID(), cell_list)
if not self.pt.operational():
# Catastrophic.
raise OperationFailure, 'cannot continue operation'
except OperationFailure: except OperationFailure:
# If not operational, send Stop Operation packets to storage nodes # If not operational, send Stop Operation packets to storage nodes
......
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