HBTreeFolder2 fixes
There's no magic in this patch series: it is known that HBTreeFolder2 has limitations about the ids that can be set without conflict, and this can't be fixed without causing compatibility issues with existing data. The patches contain: - some optimization - bug fixes - detection of id conflicts before causing data loss This will also allow us to use a newer version of ZODB. Recent BTrees failed on the following line of `_setOb`: if len(id_list) == 1 and not htree.has_key(None): (None is not valid key for comparison since ZODB commit bb5aac21277f43333d6450064dc6670c8c280e40) The long story about id conflicts is that a HBTreeFolder2 can't store 2 objects <A> and <A>-<B> where <A> does not contain '-', and that's the rule followed by _getOb/_setOb/_delOb. However: - Conflicts are detected by testing the type of the value, which means HBTreeFolder2 can't store values of the same type as the one it uses internally (i.e. OOBTree). - For performance reasons, _htree_iteritems and getTreeIdList use a stricter rule: they assume there can't be 2 objects <A> and <A>-<B>, regardless of the presence of a separator in <A>. Maybe this rule should be enforced in _setOb. /reviewed-on nexedi/erp5!112
Showing
This diff is collapsed.
Please register or sign in to comment