[Zope] Turning back system clock

Dieter Maurer dieter at handshake.de
Sat May 10 15:54:49 EDT 2008


Sinang, Danny wrote at 2008-5-6 10:28 +0800:
>The system clock of our Zope 2.7 machine accidentally got set to 2009.
>We noticed this mistake 6 hours later and we decided to set back the
>clock to 2008. 
> 
>How does this affect the integrity of Data.fs ?

Formerly, it was deadly.

Nowadays, most operations will succeed but packing will no longer
be possible (until 2009).

Here some explications.

A "FileStorage" file is a list of transaction records, identified
by a transaction id, which usually is also a timestamp.
"FileStorage" requires that the transaction ids are strictly increasing.

If transactions records were written (i.e. the corresponding transactions
committed) while you have had the wrong time, then your
storage contains some transaction records with ids corresponding to
a date in 2009.
To ensure that transaction ids are increasing, all new transaction ids
are forced to be larger than all existing ones. This means, they seem
to have happened in 2009 immediately after the latest one -- all
of them within an incredibly short time span.


As packing is usually important, you need to fix your
storage before it can be used again in a normal way.
You would use the "transaction iterators" in the
"FileStorage" package to read all transactions, fix the transaction
id (if necessary) and then write it to a new storage file.



-- 
Dieter


More information about the Zope mailing list