[ZODB-Dev] Problem with Bsddb3Storage.copyTransactionsFrom

Barry A. Warsaw barry@zope.com
Fri, 2 Nov 2001 13:27:33 -0500


>>>>> "CW" == Chris Withers <chrisw@nipltd.com> writes:

    CW> I'm trying to use the following script to pour transactions
    CW> out of a FileStorage (Zope 2.4.0) into a BerkleyStorage
    CW> (1.0b4) (having given up on FileStorage from a scalability
    CW> point of view :-S):

    CW> This is currently failing with:

<traceback snipped>

For some reason, your script is passing a None to the serial argument
to store() and you're getting a conflict that tryToResolveConflict()
is unable to resolve.  Full then wants to raise a ConflictError, but
it tries unconditionally to stringify the serial via utils.U64().
That doesn't work when passing in None.

I'll have a fix for the immediate problem in 1.0b5 of Full storage.
Basically applying this patch to current cvs:

-------------------- snip snip --------------------
Index: Full.py
===================================================================
RCS file: /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage/Full.py,v
retrieving revision 1.36
diff -u -r1.36 Full.py
--- Full.py	2 Nov 2001 17:42:17 -0000	1.36
+++ Full.py	2 Nov 2001 18:27:11 -0000
@@ -591,7 +591,7 @@
                 else:
                     raise POSException.ConflictError(
                         'serial number mismatch (was: %s, has: %s)' %
-                        (U64(oserial), U64(serial)))
+                        (U64(oserial), serial and U64(serial)))
             # Do we already know about this version?  If not, we need to
             # record the fact that a new version is being created.  `version'
             # will be the empty string when the transaction is storing on the

-------------------- snip snip --------------------

This doesn't explain why None is getting passed in though.

-Barry