[Neo-report] r1975 gregory - in /trunk/neo: master/ tests/functional/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Mar 26 17:21:15 CET 2010


Author: gregory
Date: Fri Mar 26 17:21:15 2010
New Revision: 1975

Log:
Bug fix: Admin crash with an unknown storage node.

Test case (added):
- Start a cluster with two storages
- Restart the whole cluster except one storage
- Allow recover from existing storage
- The admin crash when getting the new partition table because it doesn't
known the second (down) node.

Modified:
    trunk/neo/master/recovery.py
    trunk/neo/tests/functional/testStorage.py

Modified: trunk/neo/master/recovery.py
==============================================================================
--- trunk/neo/master/recovery.py [iso-8859-1] (original)
+++ trunk/neo/master/recovery.py [iso-8859-1] Fri Mar 26 17:21:15 2010
@@ -136,11 +136,15 @@
                     'for %s', dump(uuid), dump(self.target_uuid))
             return
         # load unknown storage nodes
+        new_nodes = []
         for offset, row in row_list:
             for uuid, state in row:
                 node = app.nm.getByUUID(uuid)
                 if node is None:
-                    app.nm.createStorage(uuid=uuid)
+                    new_nodes.append(app.nm.createStorage(uuid=uuid))
+        # notify about new nodes
+        if new_nodes:
+            self.app.broadcastNodesInformation(new_nodes)
         # load partition in memory
         try:
             self.app.pt.load(ptid, row_list, self.app.nm)

Modified: trunk/neo/tests/functional/testStorage.py
==============================================================================
--- trunk/neo/tests/functional/testStorage.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/testStorage.py [iso-8859-1] Fri Mar 26 17:21:15 2010
@@ -468,5 +468,22 @@
         self.__expectNotKnown(started[0])
         self.__expectPending(stopped[0])
 
+    def testRestartWithMissingStorage(self):
+        # start a cluster with a replica
+        (started, stopped) = self.__setup(storage_number=2, replicas=1,
+                pending_number=0, partitions=10)
+        self.__expectRunning(started[0])
+        self.__expectRunning(started[1])
+        self.neo.expectOudatedCells(number=0)
+        self.neo.expectClusterRunning()
+
+        # restart it with one storage only
+        self.neo.stop()
+        self.neo.start(except_storages=(started[1], ))
+        self.__expectRunning(started[0])
+        self.__expectUnknown(started[1])
+        self.neo.expectClusterRunning()
+
+
 if __name__ == "__main__":
     unittest.main()





More information about the Neo-report mailing list