[ZODB-Dev] data loss bug with mounted storages, cut'n'paste and pack

Chris Withers chris at simplistix.co.uk
Tue Feb 12 13:35:45 EST 2008

Hi All,

I believe I've bottomed out the bug at the centre of my POSKeyError 
report this morning and it's a real nasty. It's pretty convoluted but 
I'm fairly sure it's a bug.

Imagine the following zope.conf setup:

<zodb_db main>
      path $INSTANCE/var/UnPacked.fs
     mount-point /

<zodb_db packed>
      path $INSTANCE/var/Packed.fs
     mount-point /packed

Now, create a folder 'test' in /packed and then cut and paste it in the 
ZMI to /unpacked (a folder in the unpacked storage).

Everything appears fine and it looks like 'test' now looks like it's 
happilly living in /unpacked.

Okay, now the problem: pack the Packed.fs storage.

Now, if you try to go to /unpacked in the management interface, with 
Zope 2.10.2, you'll get a a POSKeyError.

My guess is that the 'test' folder never really gets moved to the 
UnPacked.fs storage, it's just a reference that gets created to the 
object in the Packed.fs storage.

However, the packing code doesn't apepar to take cross-db references 
into account and so lets the 'test' folder be packed away, causing the 
POSKeyError :-(

Ideas as to how to prune the resulting POSKeyError greatfully received.



PS: It appears that the fsrefs.py that ships with (at least) Zope 2.9.3 
doesn't really give meaningful output :-/

Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk

More information about the ZODB-Dev mailing list