[Zope-CVS] CVS: ZODB - NEWS.txt:1.2

Tim Peters tim.one at comcast.net
Tue Mar 16 18:51:37 EST 2004

Update of /cvs-repository/ZODB
In directory cvs.zope.org:/tmp/cvs-serv30994

Modified Files:
Log Message:
Bugfix for pack().  Approximately forever, we've seen extremely rare
failures in the ZEO FileStorage pack-while-writing tests, where they die
    CorruptedError: ... transaction with checkpoint flag set

By coincidence, the same kind of death during pack() was reported on
zodb-dev today(!).  The new checkPackLotsWhileWriting test provokes this
on my box reliably (failed each time it was run).

The problem appears to be that pack's idea of where a FileStorage
ends was obtained merely by seeking to the end of the file.  But if
a transaction is in progress, there can be an extra "not really there
yet" transaction at the end of the file, and when either buildPackIndex()
or findReachableFromFuture() bumped into a such a thing, the CorruptedError
above got raised.  This is always rare, and was exceedingly rare before
because only one pack per test was tried.  The new test tries packing
repeatedly while a thread keeps hammering the database, so is much more
likely to provoke the problem.

The fix amounts to passing FileStorage._pos to the pack code, telling
the latter directly where the legit transactions in the file end.

=== ZODB/NEWS.txt 1.1 => 1.2 ===
--- ZODB/NEWS.txt:1.1	Wed Feb 11 13:32:24 2004
+++ ZODB/NEWS.txt	Tue Mar 16 18:51:05 2004
@@ -13,6 +13,16 @@
 causing the second call to raise a StorageError before performing any
+Fixed a rare bug in pack:  if a pack started during a small window of
+time near the end of a concurrent transaction's commit, it was possible
+for the pack attempt to raise a spurious
+     CorruptedError: ... transaction with checkpoint flag set
+exception.  This did no damage to the database, or to the transaction
+in progress, but no pack was performed then.

More information about the Zope-CVS mailing list