[ZODB-Dev] Re: BTree corrupted after conflict resolution

Casey Duncan casey at zope.com
Wed Mar 3 22:02:36 EST 2004


On Wed, 3 Mar 2004 23:08:31 +0100
Dieter Maurer <dieter at handshake.de> wrote:

> John Belmonte wrote at 2004-3-3 08:55 -0500:
> > ... "__cmp__" not called during conflict resolution ...
> 
> Maybe, I understand the problem:
> 
>   During conflict resolution the state does not contain
>   the persistent subobjects themselves but only references.
> 
>   Therefore, your "__cmp__" cannot be used to compare
>   the persistent subobjects. Almost surely, the default
>   "__cmp__" is used which is, of course, wrong and
>   can lead to corruption.
> 
> Almost surely, we must add a further restriction for BTrees:
> the keys must not be persistent objects.

At the very least it should be a great big blinking "Enter at your own
risk" sign above the door.

As a personal rule I never use anything but simple types in BTree keys,
because I know I stand little to no chance of getting it right
otherwise. I've used BTrees a lot and frankly I've never had anything
but a superficial reason to use persistent objects as BTree keys.

-Casey




More information about the ZODB-Dev mailing list