Commit da1d013f authored by Vincent Pelletier's avatar Vincent Pelletier

Improve error messages when conflict resolution is detected.

- dump() values
- include oid

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2018 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent fd45cdb5
...@@ -77,15 +77,16 @@ class StorageAnswersHandler(AnswerBaseHandler): ...@@ -77,15 +77,16 @@ class StorageAnswersHandler(AnswerBaseHandler):
if pending_serial not in (None, serial) or \ if pending_serial not in (None, serial) or \
resolved_serial not in (None, serial): resolved_serial not in (None, serial):
raise NEOStorageError, 'Multiple conflicts for a single ' \ raise NEOStorageError, 'Multiple conflicts for a single ' \
'object in a single store: %r, %r, %r' % (pending_serial, 'object (%s) in a single store: %s, %s, %s' % (
resolved_serial, serial) dump(oid), dump(pending_serial),
dump(resolved_serial), dump(serial))
# If this conflict is not already resolved, mark it for # If this conflict is not already resolved, mark it for
# resolution. # resolution.
if resolved_serial is None: if resolved_serial is None:
if object_stored_counter_dict[oid]: if object_stored_counter_dict[oid]:
raise NEOStorageError, 'Storage node(s) accepted ' \ raise NEOStorageError, 'Storage node(s) accepted ' \
'object, but one (%s) reports a conflict.' % ( 'object %s, but one (%s) reports a conflict.' % (
dump(conn.getUUID()), ) dump(oid), dump(conn.getUUID()))
# Note: we might overwrite an entry, but above test protects # Note: we might overwrite an entry, but above test protects
# against overwriting a different value. # against overwriting a different value.
conflict_serial_dict[oid] = serial conflict_serial_dict[oid] = serial
......
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