Hello,<br><br> I run into a problem when doing the garbage collection via data migration. <br> The environment is elephant 0.9.1 and BDB 4.5. I also tried the latest elephant in darc and get the same result.<br>
<br> 1. Test case to reproduce the problem.<br><br> (defpclass user-profile()<br> ((id :initform nil :index t)<br> (sms-inbox :initform (make-pset))))<br> <br> ;; Create a new db for test purpose<br>
(setf *migrate-src* (open-store '(:bdb "/tmp/db/src/")))<br> (setf *test-obj* (make-instance 'user-profile :sc *migrate-src*))<br> (insert-item 'foo (slot-value *test-obj* 'sms-inbox))<br>
(setf *migrate-dst* (open-store '(:bdb "/tmp/db/dst/")))<br><br> TEST> (migrate *migrate-dst* *migrate-src*) <br> Migrating class indexes for: USER-PROFILE<br> ; => Input get blocked, not response anymore<br>
<br> 2. Using "db_stat -C A" get following output:<br> <b>1</b> Lock requests not available due to conflicts, for which we waited<br> <br> 3. I do some debug work and found the problem may be caused by nested transaction of different store controller.<br>
I can reproduce the issue with following code segment<br><br> TEST> (ensure-transaction (:store-controller *migrate-dst*)<br> (add-to-root 'foo 'foo :sc *migrate-dst*)<br>
(ensure-transaction (:store-controller *migrate-src*) <br> (add-to-root 'bar 'bar :sc *migrate-dst*)))<br> <br> This kind of nested transaction scenario can appear in the migrate process, because it uses source/destination store controller at the same time.<br>
<br> I do not understand why different store controller's transaction can result in the lock conflict and want to know how to fix it.<br><br> Is there anyone meet the similar problem before?<br>
<br>Thanks<br>Quan<br><br><br> <br> <br> <br>