[ZODB-Dev] Re: POSKeyError
Bob Horvath
zodb at horvath.com
Thu Mar 24 01:41:10 EST 2005
A long time ago, Tim Peters wrote:
> [Bob Horvath]
>
>>I have a working site that has several domains all in the same database
>>file, one of which has POSKeyErrors. I have tried the various recipes,
>>but I am very concerned I'll screw things up without a better
>>understanding.
>
>
> If you haven't read this, you should:
>
> http://zope.org/Wikis/ZODB/FileStorageBackup
>
>
>>As I understand it, POSKeyErrors are either objects that have no path
>>from the root, or objects that refer to other objects that don't exist.
>
>
> That's too complicated. Each object has an identifier, called an oid. A
> storage is essentially a mapping from oids to objects. POSKeyError occurs
> when a storage is asked to fetch the object associated with an oid, but the
> storage doesn't know about that oid. It's very similar to the KeyError you
> get when you index a Python dictionary by a key that isn't in the
> dictionary.
>
> There are really two immediate causes for POSKeyError:
>
> 1. The oid simply isn't in the database.
>
> 2. The oid is in the database, but the transaction that created
> the object was undone. Then the object still exists, but only
> in the past, and the object could become visible again if
> the undo of its creation were itself undone.
>
> In practice, #2 is at work if and only if "_loadBack_impl" shows up in a
> POSKeyError traceback.
As I am still (months later) trying to figure this out, I noticed that
my two POSKeyErrors do exhibit the symtoms of #2.
I found the transaction that had the undo of the creation...
2004/10/0621:26:36.214GMT-4/clients/horvath/1/horvath_com/folder_paste
...
data #00289 oid=000000000000cbc2 class=undo or abort of object creation
data #00290 oid=000000000000cbc3 class=undo or abort of object creation
... but when I tried to undo I get an error...
Couldn't undo change to '\x00\x00\x00\x00\x00\x00O?' because Some data
were modified by a later transaction
Does knowing the cause help me at all figure out how to get rid of it?
More information about the ZODB-Dev
mailing list