Comments (2)
the default setting won't allow multiple txn_reader
at the same time. A note in mdb_txn_begin
(http://www.lmdb.tech/doc/group__mdb.html#gad7ea55da06b77513609efebd44b26920) clarifies this:
A transaction and its cursors must only be used by a single thread, and a thread may only have a single transaction at a time. If MDB_NOTLS is in use, this does not apply to read-only transactions.
I totally missed this, with CHECK(rc = mdb_env_open(env, "./testing", MDB_NOTLS, 0664));
everything works fine :)
from rust-kv.
Thanks for reporting this!
I assumed this would work too, but after looking into this it seems to be a bit more complicated than I thought.
Even this minimal C reproduction exhibits the same behavior as your example:
#include <lmdb.h>
#include <stdio.h>
#include <stdlib.h>
#define CHECK(x) \
{ \
int y = x; \
if (y != 0) { \
printf("FAIL: %d: %d\n", __LINE__, y); \
abort(); \
}; \
}
int main(void) {
int rc;
MDB_env *env;
MDB_txn *txn, *txn2;
CHECK(rc = mdb_env_create(&env));
mdb_env_set_maxreaders(env, 1024);
CHECK(rc = mdb_env_open(env, "./testing", 0, 0664));
CHECK(rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn));
CHECK(rc = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn2));
mdb_txn_abort(txn);
mdb_txn_abort(txn2);
mdb_env_close(env);
return 0;
}
I'm not really sure if there's anything I can do in rust-kv
to make this work, but I will try to put a little more thought into this.
from rust-kv.
Related Issues (13)
- Future direction? HOT 5
- cursor iterator only works for K: From<&u[u8]> HOT 4
- Bincode support is broken HOT 1
- Questions: Performance Review and Custom Serde Serialization Schemes HOT 1
- Rethink Serde Integration HOT 7
- kv::Json not found HOT 2
- Expose something similar to the `compare_and_swap` from sled to the bucket HOT 2
- Support for multi-tree transactions HOT 1
- Passing keys by reference HOT 2
- blobs reside on disk after the key-value pair is removed HOT 2
- Error: Error in Sled: Unsupported: the 'compression' feature must be enabled HOT 1
- Segmentation fault with impl Iterator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-kv.