[elephant-devel] DB migration issue

quan hu ihuquan at gmail.com
Mon Dec 29 08:40:00 UTC 2008


Hello,

     I run into a problem when doing the garbage collection via data
migration.
     The environment is elephant 0.9.1 and BDB 4.5.  I also tried the latest
elephant in darc and get the same result.

     1.  Test case to reproduce the problem.

           (defpclass user-profile()
             ((id :initform nil :index t)
             (sms-inbox  :initform (make-pset))))

            ;; Create a new db for test purpose
           (setf *migrate-src* (open-store '(:bdb "/tmp/db/src/")))
           (setf *test-obj* (make-instance 'user-profile :sc *migrate-src*))
            (insert-item 'foo (slot-value *test-obj* 'sms-inbox))
            (setf *migrate-dst* (open-store '(:bdb "/tmp/db/dst/")))

          TEST> (migrate *migrate-dst* *migrate-src*)
              Migrating class indexes for: USER-PROFILE
           ; => Input get blocked, not response anymore

       2.  Using "db_stat -C A" get following output:
             *1*    Lock requests not available due to conflicts, for which
we waited

       3.  I do some debug work and found the problem may be caused by
nested transaction of different store controller.
            I can reproduce the issue with following code segment

          TEST> (ensure-transaction (:store-controller *migrate-dst*)
                            (add-to-root 'foo 'foo :sc *migrate-dst*)
                            (ensure-transaction (:store-controller
*migrate-src*)
                                 (add-to-root 'bar 'bar :sc *migrate-dst*)))

             This kind of nested transaction scenario can appear in the
migrate process, because it uses source/destination store controller at the
same time.

            I do not understand why different store controller's transaction
can result in the lock conflict and want to know how to fix it.

            Is there anyone meet the similar problem before?

Thanks
Quan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20081229/42ea1d5d/attachment.html>


More information about the elephant-devel mailing list