[Neo-report] r1983 gregory - in /trunk/neo: master/handlers/ storage/ storage/handlers/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Mar 30 14:05:33 CEST 2010


Author: gregory
Date: Tue Mar 30 14:05:29 2010
New Revision: 1983

Log:
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).

Modified:
    trunk/neo/master/handlers/administration.py
    trunk/neo/master/handlers/storage.py
    trunk/neo/storage/app.py
    trunk/neo/storage/handlers/initialization.py

Modified: trunk/neo/master/handlers/administration.py
==============================================================================
--- trunk/neo/master/handlers/administration.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/administration.py [iso-8859-1] Tue Mar 30 14:05:29 2010
@@ -146,7 +146,6 @@
         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)

Modified: trunk/neo/master/handlers/storage.py
==============================================================================
--- trunk/neo/master/handlers/storage.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/storage.py [iso-8859-1] Tue Mar 30 14:05:29 2010
@@ -30,7 +30,6 @@
     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):

Modified: trunk/neo/storage/app.py
==============================================================================
--- trunk/neo/storage/app.py [iso-8859-1] (original)
+++ trunk/neo/storage/app.py [iso-8859-1] Tue Mar 30 14:05:29 2010
@@ -222,10 +222,13 @@
         # 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
 

Modified: trunk/neo/storage/handlers/initialization.py
==============================================================================
--- trunk/neo/storage/handlers/initialization.py [iso-8859-1] (original)
+++ trunk/neo/storage/handlers/initialization.py [iso-8859-1] Tue Mar 30 14:05:29 2010
@@ -58,6 +58,11 @@
         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:





More information about the Neo-report mailing list