[ZODB-Dev] [CRITICAL] data loss: FileStorage._commitVersion broken (was: [Zope] Problem committing zope "version" objects)

Dieter Maurer dieter at handshake.de
Wed Jun 4 00:52:32 EDT 2003


Attention: cross post

Warnes, Gregory R wrote at 2003-6-3 10:37 -0400:
 > ...
 > If I create a file, performing a "Save" appears to have no effect.
 > All modified/created/delete objects remain locked by the version.
 > 
 > Is this a general problem with Zope?

It is a bug in "FileStorage._commitVersion", hopefully fixed
by the attached patch.

The object records belonging to a version form a linked list
via the "pv" link field. The head of the list is pointed
to by "fs._vindex[version]".

When the version is committed or aborted, the linked list must
be traversed to determine the set of objects modified in this
version.

Apparently, someone misinterpreted the traversal loop (which looks for
objects belonging to the version) as following some backpointers
and left the loop as soon as the first object was found.
As a consequence, just this one object was moved from the
version, all other objects (if any) remained with the old version
(and therefore remained locked). As the code expected to
commit (or abort) the complete version, "fs._vindex[version]" was
later deleted such that the version appeared to be empty while
there were still records associated with the version.


This is a critical bug, that should soon be fixed.


Dieter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Version.pat
Type: application/x-patch
Size: 725 bytes
Desc: Patch to "ZODB/FileStorage.py"
Url : http://lists.zope.org/pipermail/zodb-dev/attachments/20030603/074c2be6/Version.bin


More information about the ZODB-Dev mailing list