[elephant-devel] Patch for the migration issue in 1.0 Alpha2

quan hu ihuquan at gmail.com
Thu Feb 12 11:21:14 UTC 2009


Hello,

   When using the latest 1.0 codes,  0.9.1 -> 1.0 migration fails. The test
environment is SBCL, BDB4.7.
   I can reproduce the issue in 1.0 Alpha2.  The same migration test passed
in 1.0 Alpha1.
   So, it is likely a new one in 1.0 Alpha2.

    The error message "Deserialization error in map: returning nil for
element" is printed when running following codes.
   (defun migrate-from-legacy (dst src)
      (map-btree (lambda (classname classidx)
                                 ...)
                          (controller-index-table src))

    The debug shows a Recursive Lock exception is triggered in follow codes
      (defmethod controller-recreate-instance ((sc store-controller) oid
&optional classname)
                   (ele-with-lock ((controller-instance-cache-lock sc))
                       (aif (get-cached-instance sc oid) it
                           (multiple-value-bind (class schema)
(get-instance-class sc oid classname)
                           (recreate-instance-using-class class :from-oid
oid :sc sc :schema schema))=

     In 0.9.1->1.0 migration scenaro, the controller-recreate-instance could
be recursively called, one for indexed-btree, another for btree-index.
     The existing ele-with-lock uses sb-thread:with-mutex to setup the lock,
which does not support the recursive scenario.

     The simple fix is to replace sb-thread:with-mutex by
sb-thread:sb-thread:with-recursive-lock.
     The test passed.  The BDB regression test suite is also executed and
passed.
      The patch is attached.

     If this is not the suitable solution, please let me know.

Thanks
Quan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20090212/7aa3ff31/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: migration-fix-for-1.0A2.patch
Type: text/x-diff
Size: 3492 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20090212/7aa3ff31/attachment.patch>


More information about the elephant-devel mailing list