[ZODB-Dev] BTree corrupted after conflict resolution

Tim Peters tim at zope.com
Wed Mar 3 22:36:41 EST 2004


[Dieter Maurer]
> 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.

Ewwww.  Good eye, Dieter!  I'm sure you're right.  The state passed to
bucket resolution contains (at least in the ZODB 3.3a2 John is using)
instances of PersistentReference where the bucket keys live, and that's an
old-style class without an explicit __cmp__, so instances get compared by
memory address.

> Almost surely, we must add a further restriction for BTrees:
> the keys must not be persistent objects.

But that's just a special case of not using a busted __cmp__ <wink>.




More information about the ZODB-Dev mailing list