Commit 3b89b198 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Storage ask itself the last IDs when entering in service state.

This fix a race condition when switching from recovery to verification
steps where NotifyLastOID packet could be handled by verification handler
instead of initialisation (storage side).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1983 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 48c9104a
......@@ -146,7 +146,6 @@ class AdministrationHandler(MasterHandler):
app.broadcastNodesInformation(node_list)
# start nodes
for node in self.app.nm.getIdentifiedList(pool_set=uuid_set):
node.notify(Packets.NotifyLastOID(app.loid))
node.notify(Packets.StartOperation())
# broadcast the new partition table
app.broadcastPartitionChanges(cell_list)
......
......@@ -30,7 +30,6 @@ class StorageServiceHandler(BaseServiceHandler):
def connectionCompleted(self, conn):
node = self.app.nm.getByUUID(conn.getUUID())
if node.isRunning():
conn.notify(Packets.NotifyLastOID(self.app.loid))
conn.notify(Packets.StartOperation())
def nodeLost(self, conn, node):
......
......@@ -222,10 +222,13 @@ class Application(object):
# ask node list and partition table
self.has_node_information = False
self.has_partition_table = False
self.has_last_ids = False
self.pt.clear()
self.master_conn.ask(Packets.AskLastIDs())
self.master_conn.ask(Packets.AskNodeInformation())
self.master_conn.ask(Packets.AskPartitionTable(()))
while not self.has_node_information or not self.has_partition_table:
while not self.has_node_information or not self.has_partition_table \
or not self.has_last_ids:
self.em.poll(1)
self.ready = True
......
......@@ -58,6 +58,11 @@ class InitializationHandler(BaseMasterHandler):
app.dm.setPartitionTable(ptid, cell_list)
self.app.has_partition_table = True
def answerLastIDs(self, conn, loid, ltid, lptid):
self.app.tm.setLastOID(loid)
self.app.dm.setLastOID(loid)
self.app.has_last_ids = True
def notifyPartitionChanges(self, conn, ptid, cell_list):
# XXX: This is safe to ignore those notifications because all of the
# following applies:
......
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