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

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 1 10:18:07 CEST 2010


Author: gregory
Date: Fri Oct  1 10:18:06 2010
New Revision: 2319

Log:
Forget a lost storage node from all data structures.

Otherwise the getUUIDList() used to notify non-lost storage nodes that
the transaction is fully locked will also return the uuid of the lost node.

Modified:
    trunk/neo/master/transactions.py
    trunk/neo/tests/master/testStorageHandler.py
    trunk/neo/tests/master/testTransactions.py

Modified: trunk/neo/master/transactions.py
==============================================================================
--- trunk/neo/master/transactions.py [iso-8859-1] (original)
+++ trunk/neo/master/transactions.py [iso-8859-1] Fri Oct  1 10:18:06 2010
@@ -91,6 +91,7 @@ class Transaction(object):
         # data but was later found to be disconnected. This loss has no impact
         # on current code, but it might be disturbing to reader or future code.
         self._lock_wait_uuid_set.discard(uuid)
+        self._uuid_set.discard(uuid)
         return self.locked()
 
     def lock(self, uuid):

Modified: trunk/neo/tests/master/testStorageHandler.py
==============================================================================
--- trunk/neo/tests/master/testStorageHandler.py [iso-8859-1] (original)
+++ trunk/neo/tests/master/testStorageHandler.py [iso-8859-1] Fri Oct  1 10:18:06 2010
@@ -238,6 +238,8 @@ class MasterStorageHandlerTests(NeoTestB
         # Check state after node lost
         # T1: last locking node lost, client receives AnswerTransactionFinished
         self.checkAnswerTransactionFinished(cconn1)
+        self.checkNotifyUnlockInformation(conn2)
+        self.checkNoPacketSent(conn1)
         # ...and notifications are sent to other clients
         self.checkInvalidateObjects(cconn2)
         self.checkInvalidateObjects(cconn3)

Modified: trunk/neo/tests/master/testTransactions.py
==============================================================================
--- trunk/neo/tests/master/testTransactions.py [iso-8859-1] (original)
+++ trunk/neo/tests/master/testTransactions.py [iso-8859-1] Fri Oct  1 10:18:06 2010
@@ -178,11 +178,14 @@ class testTransactionManager(NeoTestBase
         # Storage 1 dies:
         # t1 is over
         self.assertTrue(t1.forget(storage_1_uuid))
+        self.assertEqual(t1.getUUIDList(), [storage_2_uuid])
         # t2 still waits for storage 2
         self.assertFalse(t2.forget(storage_1_uuid))
+        self.assertEqual(t2.getUUIDList(), [storage_2_uuid])
         self.assertTrue(t2.lock(storage_2_uuid))
         # t3 doesn't care
         self.assertFalse(t3.forget(storage_1_uuid))
+        self.assertEqual(t3.getUUIDList(), [storage_2_uuid])
         self.assertTrue(t3.lock(storage_2_uuid))
 
 if __name__ == '__main__':





More information about the Neo-report mailing list