Firstly, thanks for the awesome lmdb storage engine.
I am trying to use lmdb as the reference algorithm for some
of the experiments that I am doing. One of them involve an
left-leaning-red-black (LLRB) tree implementation.
This particular issue keep coming up with dbtest/ program where
it does randomized testing of LLRB API, using LMDB as reference.
It is easy to reproduce:
$ go get github.com/bnclabs/dbtest
$ cd <dbtest>
$ go get ./...
// To test llrb with lmdb as reference.
$ ./llrb.sh
This command loads 1 million key,value entries (keysize:32 bytes,
valuesize: 32 bytes) into llrb instance and lmdb instance. And then
starts concurrent writer and reader routines that will access the llrb
and lmdb instance and validate the result. This test will complete
after executing 4 million write operations.
Meanwhile, there is validator routine that wakes up every 10 second,
block all write operations, and execute a full table iteration on both
llrb and lmdb instance, to check both indexes contain same set of
entries and identically sorted. This full-table comparision is done
by compareLlrbLmdb() function:
func compareLlrbLmdb( index *llrb.LLRB, lmdbenv *lmdb.Env, lmdbdbi lmdb.DBI)
Note that compareLlrbLmdb() uses lmdbscan/ sub-package to do full-table
comparision. Here is the o/p of compareLlrbLmdb() function:
Firstly, thanks for the awesome lmdb storage engine.
I am trying to use lmdb as the reference algorithm for some of the experiments that I am doing. One of them involve an left-leaning-red-black (LLRB) tree implementation.
This particular issue keep coming up with dbtest/ program where it does randomized testing of LLRB API, using LMDB as reference. It is easy to reproduce:
llrb.sh
invokes dbtest as:This command loads 1 million key,value entries (keysize:32 bytes, valuesize: 32 bytes) into llrb instance and lmdb instance. And then starts concurrent writer and reader routines that will access the llrb and lmdb instance and validate the result. This test will complete after executing 4 million write operations.
Meanwhile, there is validator routine that wakes up every 10 second, block all write operations, and execute a full table iteration on both llrb and lmdb instance, to check both indexes contain same set of entries and identically sorted. This full-table comparision is done by compareLlrbLmdb() function:
Note that compareLlrbLmdb() uses
lmdbscan/
sub-package to do full-table comparision. Here is the o/p of compareLlrbLmdb() function:One anomaly that comes up right away is that lmdb says 1038940 items are indexes while llrb says 1046704 items are indexed.
Is there a delay in flushing the recent set of write operations ? Is this something to do with read snapshot trailing behind the tip ?
I would greatly appreciate your help on this. Thanks in advance,