[ZODB-Dev] ZEO and replication of BTree based objects

Tim Peters tim_one at email.msn.com
Thu Jun 5 03:13:38 EDT 2003


[Roché Compaan]
> ...
> Sorry for my ignorance but when will a bucket split? Guess when it's
> full ;-)

Actually, when it's a little more than full <wink>.  The maximum size of a
bucket depends on the kind of bucket it is (== the kind of BTree it belongs
to), and is measured by the number of key+value pairs in the bucket:

    IIBTree  120
    IOBTree   60
    OIBTree   60
    OOBTree   30

These numbers aren't tunable, and were chosen mostly to keep pickle sizes
reasonable.  Integers require (possibly much) less pickle space than
arbitrary objects, so the more I's in a flavor of BTree, the more key+value
pairs its buckets are allowed to hold.

Note that buckets implement a conflict resolution strategy, and it's not
necessarily bad if two transactions add *different* keys to the same bucket:
conflict resolution will resolve this automatically, producing a bucket with
both new key+value pairs.  That's assuming the bucket didn't split in either
transaction.  If the bucket does split, in either or both transactions,
conflict resolution gives up (BTrees are stitched together via three
distinct kinds of cross-object pointers, and topology changes due to bucket
splits-- or bucket removals --can have far-ranging ripple effects on all
these pointers).




More information about the ZODB-Dev mailing list