[Neo-report] r2518 vincent - in /trunk/neo/client: app.py handlers/storage.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Dec 13 11:56:20 CET 2010
Author: vincent
Date: Mon Dec 13 11:56:19 2010
New Revision: 2518
Log:
Fix the meaning of txn_voted.
It was actually used to track individual answerStoreTransaction, and there
is no need to track them individually.
Instead, just set txn_voted to True before returning, so it really means
that tpc_vote ended successfully.
Modified:
trunk/neo/client/app.py
trunk/neo/client/handlers/storage.py
Modified: trunk/neo/client/app.py
==============================================================================
--- trunk/neo/client/app.py [iso-8859-1] (original)
+++ trunk/neo/client/app.py [iso-8859-1] Mon Dec 13 11:56:19 2010
@@ -800,15 +800,11 @@ class Application(object):
if conn is None:
continue
- local_var.txn_voted = False
try:
self._askStorage(conn, p)
add_involved_nodes(cell.getNode())
except ConnectionClosed:
continue
-
- if not self.isTransactionVoted():
- raise NEOStorageError('tpc_vote failed')
voted_counter += 1
# check at least one storage node accepted
@@ -820,6 +816,7 @@ class Application(object):
# tpc_finish.
self._getMasterConnection()
+ local_var.txn_voted = True
return result
@profiler_decorator
@@ -1233,12 +1230,6 @@ class Application(object):
def getTID(self):
return self.local_var.tid
- def setTransactionVoted(self):
- self.local_var.txn_voted = True
-
- def isTransactionVoted(self):
- return self.local_var.txn_voted
-
def pack(self, t):
tid = repr(TimeStamp(*time.gmtime(t)[:5] + (t % 60, )))
if tid == ZERO_TID:
Modified: trunk/neo/client/handlers/storage.py
==============================================================================
--- trunk/neo/client/handlers/storage.py [iso-8859-1] (original)
+++ trunk/neo/client/handlers/storage.py [iso-8859-1] Mon Dec 13 11:56:19 2010
@@ -94,7 +94,6 @@ class StorageAnswersHandler(AnswerBaseHa
def answerStoreTransaction(self, conn, tid):
if tid != self.app.getTID():
raise ProtocolError('Wrong TID, transaction not started')
- self.app.setTransactionVoted()
def answerTransactionInformation(self, conn, tid,
user, desc, ext, packed, oid_list):
More information about the Neo-report
mailing list