Commit 150b0074 authored by Aurel's avatar Aurel

if connection to SN failed in store method, treatment goes on except

if no store at all can be done


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@583 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bcc6493c
......@@ -518,6 +518,7 @@ class Application(object):
# Store data on each node
compressed_data = compress(data)
checksum = makeChecksum(compressed_data)
self.local_var.object_stored_counter = 0
for cell in cell_list:
#logging.info("storing object %s %s" %(cell.getServer(),cell.getState()))
conn = self.cp.getConnForNode(cell)
......@@ -527,7 +528,10 @@ class Application(object):
self.local_var.object_stored = 0
p = protocol.askStoreObject(oid, serial, 1,
checksum, compressed_data, self.local_var.tid)
try:
self._askStorage(conn, p)
except NEOStorageConnectionFailure:
continue
# Check we don't get any conflict
if self.local_var.object_stored[0] == -1:
......@@ -539,6 +543,12 @@ class Application(object):
del self.local_var.data_dict[oid]
self.conflict_serial = self.local_var.object_stored[1]
raise NEOStorageConflictError
# increase counter so that we know if a node has stored the object or not
self.local_var.object_stored_counter += 1
if self.local_var.object_stored_counter == 0:
# no storage nodes were available
raise NEOStorageError('tpc_store failed')
# Store object in tmp cache
noid, nserial = self.local_var.object_stored
......
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