[ZODB-Dev] Backing up a ZODB

Tim Peters tim at zope.com
Wed Oct 29 17:41:45 EST 2003


[Tim]
>> That's not *quite* true, and because of it plain copying is
>> vulnerable to screwing up the last transaction in the database.

[Neil Schemenauer]
> How so?  Isn't the transaction marker written atomically?

Yes, but more than once.  That little status byte is first set to 'c', then
the new transaction is appended, and then it seeks back to the location of
the status byte and overwrites it with a blank.  That's the way in which
filestorage isn't changed solely by appending.  If you copy the last
transaction while the status byte still contains 'c', then you can't append
to the copy later and expect things to work.

repozo.py is robust against this (if the last transaction has 'c' status
when repozo starts, repozo doesn't copy that transaction -- such a
transaction is still in progress, and can still fail for nasty reasons
(e.g., it's possible to run out of disk space after the 'c' is written but
before the transaction's full data is written out)).




More information about the ZODB-Dev mailing list