Commit 4240199e authored by Aurel's avatar Aurel

fix variable name in store

raise if no storage can serve object


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@132 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ae101b47
......@@ -134,7 +134,7 @@ class Application(ThreadingMixIn, object):
self.tid = None
self.txn = None
self.txn_data_dict = {}
self.txn_obj_stored = 0
self.txn_object_stored = 0
self.txn_voted = 0
self.txn_finished = 0
# Internal attribute distinct between thread
......@@ -305,6 +305,8 @@ class Application(ThreadingMixIn, object):
data = None
# Store data on each node
if len(storage_node_list) == 0:
raise NEOStorageNotFoundError()
for storage_node in storage_node_list:
conn = self.cm.getConnForNode(storage_node)
if conn is None:
......@@ -446,7 +448,7 @@ class Application(ThreadingMixIn, object):
# previous node which already store data as it would be resent
# again if conflict is resolved or txn will be aborted
del self.txn_data_dict[oid]
self.conflict_serial = self.object_stored[1]
self.conflict_serial = self.txn_object_stored[1]
raise NEOStorageConflictError
# Store object in tmp cache
......
......@@ -45,6 +45,7 @@ class ClientEventHandler(EventHandler):
EventHandler.connectionClosed(self, conn)
elif uuid == self.app.master_conn.getUUID():
logging.critical("connection to primary master node closed")
# FIXME, client must try to connect to master node again
raise NEOStorageError("connection to primary master node closed")
else:
app = self.app
......@@ -374,9 +375,9 @@ class ClientEventHandler(EventHandler):
if isinstance(conn, ClientConnection):
app = self.app
if conflicting == '1':
app.object_stored = -1, serial
app.txn_object_stored = -1, serial
else:
app.object_stored = oid, serial
app.txn_object_stored = oid, serial
else:
self.handleUnexpectedPacket(conn, packet)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment