Coder Social home page Coder Social logo

lmdb-go's People

Contributors

a-kr avatar benbjohnson avatar bmatsuo avatar burke avatar dinedal avatar docsavage avatar harikb avatar hyc avatar jvshahid avatar lmb avatar maximelenoir avatar mdennebaum avatar szferi avatar thehydroimpulse avatar

Watchers

 avatar

lmdb-go's Issues

Repo state

Background

This repo is a verbatim copy of github.com/bmatsuo/lmdb-go with two files from github.com/kellabyte/rewind rewind.c and that trimmed to a rewind.h

Only relevant commit is 44b77dc

Other commits are simply replacing the builtin self references for bmatsuo/lmdb-go to harikb/lmdb-go. I tried avoiding this change using go mod's replace feature but failed miserably. I also had to create a 1.9.0 tag so that is wouldn't automatically go fetch 1.8.0 (which didn't have my changes).

How to run the test code

> GO111MODULE=on make bin
> bin/try_rewind -h
Usage of bin/try_rewind:
  -b, --batch-count int   Number of records per trasaction (default 100)
  -r, --enable-rewind     Enable rewind
  -l, --loop-count int    Number of transactions to run (default 100)
pflag: help requested


Where I am stuck - database selection (root/main vs named) is wrong???

> time bin/try_rewind -b 10 -l 1000
2019/02/03 09:15:46 Updated 10000 entries
2019/02/03 09:15:46 Checked 10000 entries

real	0m1.352s
user	0m0.152s
sys	0m0.807s
harikb ~/code/src/github.com/harikb/lmdb-go  [ 9:15:46]> time bin/try_rewind -b 10 -l 1000 -r
2019/02/03 09:15:55 REWIND ENABLED
2019/02/03 09:15:55 Updated 10000 entries
panic: mdb_get: MDB_NOTFOUND: No matching key/data pair found

goroutine 1 [running]:
main.main()
	/Users/harikb/code/src/github.com/harikb/lmdb-go/cmd/try_rewind/main.go:145 +0x5c8

real	0m0.457s
user	0m0.083s
sys	0m0.280s

  1. @kellabyte 's repo used a much newer version of LMDB source code. there seems to be differences from the one used by @bmatsuo 's library.

  2. I think the issue is with mdb_dbi_open. In the current code, I think Kelly's code opens the "main" db for the log cursor.

  3. In my earlier attempt, when I tried dbi, err = txn.CreateDBI("example") for this line
    I got

> time bin/try_rewind -b 10 -l 1000 -r
2019/02/03 09:25:06 REWIND ENABLED
panic: mdb_dbi_open: MDB_INCOMPATIBLE: Operation and DB incompatible, or DB flags changed

goroutine 1 [running]:
main.main()
	/Users/harikb/code/src/github.com/harikb/lmdb-go/cmd/try_rewind/main.go:69 +0x5e8

real	0m0.010s
user	0m0.003s
sys	0m0.004s

1.. With the current code of using OpenRoot (is Root same as Main db?), data seems to be doing to the log directory, and moreover, inaccessible for read later

harikb ~/code/src/github.com/harikb/lmdb-go  [ 9:31:38]> ls -al /tmp/lmdb-test/
total 0
drwxr-xr-x   3 harikb  wheel   96 Feb  3 09:31 .
drwxrwxrwt  26 root      wheel  832 Feb  3 09:31 ..
drwx------   4 harikb  wheel  128 Feb  3 09:31 log
harikb ~/code/src/github.com/harikb/lmdb-go  [ 9:31:47]> ls -al /tmp/lmdb-test/log
total 42224
drwx------  4 harikb  wheel       128 Feb  3 09:31 .
drwxr-xr-x  3 harikb  wheel        96 Feb  3 09:31 ..
-rw-r--r--  1 harikb  wheel  21610496 Feb  3 09:31 data.mdb
-rw-r--r--  1 harikb  wheel      8192 Feb  3 09:31 lock.mdb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.