[ZODB-Dev] Re: [Bug] ZODB invalidation processing
Tres Seaver
tseaver at palladion.com
Fri Jun 1 08:28:01 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Joachim Schmitz wrote:
> Tres Seaver schrieb:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Not if the sessions being used are from 'faster' -- it doesn't use
>> IOBTree. The major "application" use of that module is in the catalog.
>>
> you correct see below:
>
>> Try dumping out the contents of the bucket:
>>
>> for k, v in bucket.items():
>> print k, type(v)
>
> resolve <built-in method _p_resolveConflict of BTrees._IOBTree.IOBucket
> object at 0xb1ab82b4>
>
> print root._p_jar[p64(0xb1ab82b4)]
> *** POSKeyError: <ZODB.POSException.POSKeyError instance at 0xa8f9e6cc>
>
> with the recepies here http://www.zopelabs.com/cookbook/1114086617
> I was able to get the information about the oid, which is passed to
> tryToResolveConflict, here is the result
>
> <BTrees._IOBTree.IOBTree object at 0xb562fadc>
> <DateIndex at created>
> <Products.ZCatalog.Catalog.Catalog object at 0xb12d622c>
> <CatalogTool at portal_catalog>
> <CPSDefaultSite at uniben>
> <Application at >
> {'Application': <Application at >, 'ZGlobals': <BTrees._OOBTree.OOBTree
> object at 0xb2739224>}
>
> What does this tell us ?
That is a "real" conflict: both transactions have inserted values into
the 'created' date index's '_index' under the same key, which can't be
resolved. Retrying the transaction is the only choice here.
Because DateIndexes convert the indexed value to an integer with
precision of one minute, a date index on 'created' is fairly likely to
generate such conflicts when two parties both create content at the same
time.
Ideally, one would examine the two values being inserted, note that they
were both IITreeSet instances containing one int apiece, and exploit our
knowledge of the application semantics to merge them, removing the
conflict; however, *because* they are IITreeSets, and therefore
separate persistent objects, their state is not available to the
bucket's '_p_resolveConflict', which must therefore lose.
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGYBDQ+gerLs4ltQ4RAoRNAKCb86Bjhp5fuk7bp9OV2IMUXDKm7ACeO/aH
hVfzx/U0rXsM3iNT2fOl2As=
=egtx
-----END PGP SIGNATURE-----
More information about the ZODB-Dev
mailing list