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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 5 15:45:35 CET 2011


Author: gregory
Date: Wed Jan  5 15:45:35 2011
New Revision: 2585

Log:
Send a notification when a node is lost during recovery step.

Add a test to ensure the admin is notified of connected/disconnected
nodes during recovery.

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

Modified: trunk/neo/master/recovery.py
==============================================================================
--- trunk/neo/master/recovery.py [iso-8859-1] (original)
+++ trunk/neo/master/recovery.py [iso-8859-1] Wed Jan  5 15:45:35 2011
@@ -108,6 +108,8 @@ class RecoveryManager(MasterHandler):
         if node.getState() == new_state:
             return
         node.setState(new_state)
+        # broadcast to all so that admin nodes gets informed
+        self.app.broadcastNodesInformation([node])
 
     def connectionCompleted(self, conn):
         # XXX: handler split review needed to remove this hack

Modified: trunk/neo/tests/functional/testCluster.py
==============================================================================
--- trunk/neo/tests/functional/testCluster.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/testCluster.py [iso-8859-1] Wed Jan  5 15:45:35 2011
@@ -127,6 +127,32 @@ class ClusterTests(NEOFunctionalTest):
         transaction.commit()
         self.assertEqual(len(self.neo.getClientlist()), 1)
 
+    def testStorageLostDuringRecovery(self):
+        """
+            Check that admin node receive notifications of storage
+            connection and disconnection during recovery
+        """
+        self.neo = NEOCluster(['test_neo%d' % i for i in xrange(2)],
+            master_node_count=1, partitions=10, replicas=1,
+            temp_dir=self.getTempDirectory(), clear_databases=True,
+        )
+        storages  = self.neo.getStorageProcessList()
+        self.neo.run(except_storages=storages)
+        self.neo.expectStorageNotKnown(storages[0])
+        self.neo.expectStorageNotKnown(storages[1])
+        storages[0].start()
+        self.neo.expectRunning(storages[0])
+        self.neo.expectStorageNotKnown(storages[1])
+        storages[1].start()
+        self.neo.expectRunning(storages[0])
+        self.neo.expectRunning(storages[1])
+        storages[0].stop()
+        self.neo.expectUnavailable(storages[0])
+        self.neo.expectRunning(storages[1])
+        storages[1].stop()
+        self.neo.expectUnavailable(storages[0])
+        self.neo.expectUnavailable(storages[1])
+
 def test_suite():
     return unittest.makeSuite(ClusterTests)
 




More information about the Neo-report mailing list