[ZODB-Dev] fixing far-future timestamps (patch)
Jim Fulton
jim at zope.com
Thu Jun 4 13:13:04 EDT 2009
On Jun 4, 2009, at 12:04 PM, Ross J. Reedstrom wrote:
> Hi all -
> I'm one of the unfortunates who managed to break a Data.fs when
> migrating a ZEO backend to new hardware. Unfortunately, I missed the
> 'CRITICAL' error logged by ZOE (aside: is there a "fail_on_critical"
> option somewhere?) and ended up with transaction ids that parse as
> timestamps in the year 4732 (or there abouts). This caused
> surprisingly
> few issues for our Zope/Plone install. Of course ZODB itself, didn't
> care, it just started using incremental tids. The biggest impact was
> that packing had no effect any more. (Versions are Zope 2.9.10, ZODB
> 3.6.3)
>
> Long story short, I dug into the code for FileStorage, and patched
> copyTransactionsFrom to detect and correct future timestamps. This
> approach was inspired by the existing code that detects and corrects
> out-of-order transactions, as well as the FileStorage __init__ code
> that detects future timestamps. I've attached a patch.
>
> I've successfully used this in a small python script to correct my
> problem, reading one FileStorage and writing a new one. I thought I
> should send this here, for comment. Is this something that should go
> into mainline ZODB?
+1, with tests. :)
Jim
--
Jim Fulton
Zope Corporation
More information about the ZODB-Dev
mailing list