Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !112

Merged
Created May 09, 2016 by Julien Muchembled@jmOwner

HBTreeFolder2 fixes

  • Overview 4
  • Commits 8
  • Changes 3

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.

What I suggest here is:

  • some optimization
  • bug fixes
  • detect id conflicts before causing data loss

I also started to study this product when trying to use a newer version of ZODB. Recent BTrees fails on the following line of _setOb:

        if len(id_list) == 1 and not htree.has_key(None):

(None is not valid key for comparison)

One of the commit removes _tree_list. I hope this does not make getTreeIdList too slow.

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.
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: HBTreeFolder2
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7