[ZCM] [ZC] 1505/ 5 Reject "OOBTree won't allow more than ~1700 items"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed Sep 22 17:02:21 EDT 2004


Issue #1505 Update (Reject) "OOBTree won't allow more than ~1700 items"
 Status Rejected, Database/bug critical
To followup, visit:
  http://collector.zope.org/Zope/1505

==============================================================
= Reject - Entry #5 by tim_one on Sep 22, 2004 5:02 pm

 Status: Pending => Rejected

Sorry, this is pilot error -- this script will never "work".  Please read the docs, especially section 5.3.1 (Total Ordering and Persistence) in the ZODB programming guide:

http://zope.org/Wikis/ZODB/FrontPage/guide/index.html

It explains why instances of your class X can't be used successfully as keys in an OOBTree (or OIBTree) stored to disk (although they're fine for a purely in-memory btree -- read the docs).
________________________________________
= Comment - Entry #4 by mscott on Sep 22, 2004 4:21 pm

Updated the script at the previously-given URL to contain a workaround "CustomTree" class that allows me to continue using OOBTree even though it doesn't work with instances as keys.

Invoke with "python zodbfailure.py CustomTree", it isn't in the default lists of tests.

________________________________________
= Comment - Entry #3 by mscott on Sep 22, 2004 4:12 pm

Can't seem to upload the script so I'll just post an URL.

http://goldenspud.com/zodbfailure.py
________________________________________
= Comment - Entry #2 by mscott on Sep 22, 2004 4:11 pm


Uploaded:  "zodbfailure2.py"
 - http://collector.zope.org/Zope/1505/zodbfailure2.py/view

________________________________________
= Request - Entry #1 by mscott on Sep 22, 2004 4:09 pm


Uploaded:  "zodbfailure.py"
 - http://collector.zope.org/Zope/1505/zodbfailure.py/view
When using OOBTree to store a dictionary whose keys are objects and values are integers, I am running into a problem where after about ~1700 objects are stored, the OOBTree has problems finding objects in the collection.  The following successes and failures are what I got from running the attached zodbfailure.py program.

 Testing ZODB version 3.3c1
 with Python version 2.3.4 (#2, Sep 18 2004, 09:58:43)
 [GCC 3.3.4 (Debian 1:3.3.4-11)]
 
 Trying <class 'persistent.mapping.PersistentMapping'>
 0 500 1000 1500 2000 2500 3000 
 
 
 -----------------------------------------------------------------
 
 
 Testing ZODB version 3.3c1
 with Python version 2.3.4 (#2, Sep 18 2004, 09:58:43)
 [GCC 3.3.4 (Debian 1:3.3.4-11)]
 
 Trying <type 'BTrees._OOBTree.OOBTree'>
 0 500 1000 1500
 *** FAILURE AT 1728 ***
 Traceback (most recent call last):
   File "zodbfailure.py", line 63, in ?
     runTest(root, MappingClass)
   File "zodbfailure.py", line 39, in runTest
     assert(d[x] == num)
 KeyError: <__main__.X object at 0x4042d32c>
 
 
 -----------------------------------------------------------------
 
 
 Testing ZODB version 3.3c1
 with Python version 2.3.4 (#53, May 25 2004, 21:17:02) 
 [MSC v.1200 32 bit (Intel)]
 
 Trying <class 'persistent.mapping.PersistentMapping'>
 0 500 1000 1500 2000 2500 3000
 
 
 -----------------------------------------------------------------
 
 
 Testing ZODB version 3.3c1
 with Python version 2.3.4 (#53, May 25 2004, 21:17:02) 
 [MSC v.1200 32 bit (Intel)]
 
 Trying <type 'BTrees._OOBTree.OOBTree'>
 0 500 1000 1500
 *** FAILURE AT 1782 ***
 Traceback (most recent call last):
   File "zodbfailure.py", line 63, in ?
     runTest(root, MappingClass)
   File "zodbfailure.py", line 39, in runTest
     assert(d[x] == num)
 KeyError: <__main__.X object at 0x00AA4AB0> 

==============================================================



More information about the Zope-Collector-Monitor mailing list