[elephant-devel] A new Postmodern backend

Henrik Hjelte henrik at evahjelte.com
Tue Mar 20 19:26:30 UTC 2007


On Tue, 2007-03-20 at 11:04 -0400, Ian Eslick wrote:
> Henrik,
> 
> Can you run a clean version of the latest CVS on your 64-bit SBCL  
> implementation?  

I have run it with bdb and clsql backends. The winner is .... 
clsql with zero failings! Right now Berkeley DB fails some times, but
the faults seems related to an extra return value from with-transaction.
I haven't dug deep with this. It seems like a minor thing, I tried a
simple fix in the testcase, see below. What should the return value
actually be, what is the best way to solve it? I can continue debugging
when I know.

A minor thing, if late minute changes are allowed, maybe the contents of
my attached my-config.sexp can be added to config.sexp with a #+(and
sbcl linux). My Berkeley DB was built from source with default options,
so it is probably correct for most linuxes.

Another late thing, I have found a strange thing/bug in
slot-bound-p-using-class that maybe should go into the release. See
below.

And the almost last thing, today I found another problem in
collections.lisp, map-index method. See below.

And the last thing: I thought I should use the new trac issue handling.
But I couldn't find out where to submit new Issues? I must be missing
something obvious. I tried to login with my common-lisp.net account but
that didn't work either (and maybe shouldn't).

Best wises,
Henrik Hjelte


Currently failing tests:
17 out of 126 total tests failed: GET-FIRST, GET-FIRST2, GET-LAST, 
   GET-LAST2, SET, SET2, SET-RANGE, SET-RANGE2, REM-KV, REM-IDEXKV, 
   DUP-TEST, NODUP-TEST, PREV-NODUP-TEST, PNODUP-TEST, PPREV-NODUP-TEST,
CUR-DEL1, CUR-DEL2.

Fix in the testcase:

ELE-TESTS> (with-open-store (*default-spec*) (do-test 'get-first))
Test GET-FIRST failed
Form: (WITH-TRANSACTION (:STORE-CONTROLLER *STORE-CONTROLLER*)
                        (WITH-BTREE-CURSOR (C INDEX1)
                                           (MULTIPLE-VALUE-BIND
                                               (HAS K V)
                                               (CURSOR-FIRST C)
                                             (DECLARE (IGNORE HAS V))
                                             (= K 4))))
Expected value: T
Actual values: T
               5864070364760.
NIL
ELE-TESTS> (deftest get-first
    (prog1
        (with-transaction (:store-controller *store-controller*)
          (with-btree-cursor (c index1)
            (multiple-value-bind (has k v)
                (cursor-first c)
              (declare (ignore has v))
              (= k 4)))))
  t)

WARNING: Redefining test GET-FIRST
GET-FIRST
ELE-TESTS> (with-open-store (*default-spec*) (do-test 'get-first))
GET-FIRST
ELE-TESTS> 


------------ bug or whatever in slot-bound-p-using-class  -------------
In classes.lisp, around line 243:

(defmethod slot-boundp-using-class :around 
((class persistent-metaclass)
 (instance persistent-object)
 (slot-def persistent-slot-definition))
  "Checks if the slot exists in the database."
  (when instance
    (let ((name (slot-definition-name slot-def)))
      (persistent-slot-boundp (get-con instance) instance name))))

For some reason this method sometimes can be invoked when instance is
nil. Is this the way Lisp methods should work? I would expect that
instance always should be a persistent-object, never nil.
Anyway, a nil value of instance make the method fail when trying to
get-con, so I have changed it like this:

-  (let ((name (slot-definition-name slot-def)))
-    (persistent-slot-boundp (get-con instance) instance name)))
+  (when instance
+    (let ((name (slot-definition-name slot-def)))
+      (persistent-slot-boundp (get-con instance) instance name))))


--------------  bug in map-index --------------------------------
  * bugfix map-index when start parameter is nil. Previously
(get-instances-by-value 'class-name 'slot-name nil) would return a
random "first" instance even though the slot-name was not nil

    hunk ./src/elephant/collections.lisp 351
    -(defmethod map-index (fn (index btree-index) &rest args &key start
end)
    +(defmethod map-index (fn (index btree-index) &rest args &key (start
nil start-supplied-p) end)
    hunk ./src/elephant/collections.lisp 377
    -         (if start
    +         (if start-supplied-p

----------------------------------------------------------------


-------------- next part --------------
((:berkeley-db-include-dir . "/usr/local/BerkeleyDB.4.5/include/")
 (:berkeley-db-lib-dir . "/usr/local/BerkeleyDB.4.5/lib")
 (:berkeley-db-lib . "/usr/local/BerkeleyDB.4.5/lib/libdb-4.5.so")
 (:berkeley-db-deadlock . "/usr/local/BerkeleyDB.4.5/bin/db_deadlock")
 (:pthread-lib . nil)
 (:clsql-lib . nil)
 (:compiler . :gcc))


More information about the elephant-devel mailing list