ZODB 3.10.1: Connection.commit() does not check all oids against _storage.checkCurrentSerialInTransaction()

Bug #707332 reported by Jürgen Herrmann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB
Invalid
Undecided
Unassigned

Bug Description

In Connection.py, around line 570 we have:

        for oid, serial in self._readCurrent.iteritems():
            try:
                self._storage.checkCurrentSerialInTransaction(oid, serial, transaction)
            except ConflictError:
                self._cache.invalidate(oid)
                raise

so, if a call into checkCurrentSerialInTransaction() raises a ConflictError, the corresponding oid is invalidated in the cache and the ConflictError is reraised. This leads to early termination of the loop and possibly leaves other objects in the cache that need to be invalidated.

My quick solutuion looks like this:

        lastException = None
        for oid, serial in self._readCurrent.iteritems():
            try:
                self._storage.checkCurrentSerialInTransaction(oid, serial, transaction)
            except ConflictError, e:
                self._cache.invalidate(oid)
                lastException = e
        if lastException:
            raise lastException

This fixes a couple of unrecoverable ReadConflictErrors in my databasses. Even the retry of transactions with conflicts failed before, because not all objects were properly invalidated when needed.

description: updated
Revision history for this message
Jürgen Herrmann (xlhost) wrote :

I posted too early - this did NOT fix my problem. I'm currently seeing unresolved read conflict errors in my zope2 event.log that start ~1-4 hours after zope startup, very sporadic and are gone at zope2 restarts. I'm currently trying to track this down, will post further info, when i have it. debuggin/testing this is extremely difficulty, as i don't yet have a way to provoke those read conflict errors.

Changed in zodb:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.