Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lmdb to 0.8 #6607

Merged
merged 1 commit into from Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 8 additions & 14 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/rust/engine/fs/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ ignore = "0.3.1"
indexmap = "1"
itertools = "0.7.2"
lazy_static = "1"
lmdb = "0.7.2"
lmdb = "0.8"
log = "0.4"
parking_lot = "0.6"
protobuf = { version = "2.0.4", features = ["with-bytes"] }
Expand Down
13 changes: 9 additions & 4 deletions src/rust/engine/fs/src/store.rs
Expand Up @@ -629,8 +629,8 @@ mod local {
use hashing::{Digest, Fingerprint};
use lmdb::Error::{KeyExist, NotFound};
use lmdb::{
self, Cursor, Database, DatabaseFlags, Environment, RwTransaction, Transaction, WriteFlags,
NO_OVERWRITE, NO_SYNC, NO_TLS,
self, Cursor, Database, DatabaseFlags, Environment, EnvironmentFlags, RwTransaction,
Transaction, WriteFlags,
};
use resettable::Resettable;
use sha2::Sha256;
Expand Down Expand Up @@ -886,7 +886,12 @@ mod local {

let (env, content_database, lease_database) = dbs.get()?.get(&fingerprint);
let put_res = env.begin_rw_txn().and_then(|mut txn| {
txn.put(content_database, &fingerprint, &bytes, NO_OVERWRITE)?;
txn.put(
content_database,
&fingerprint,
&bytes,
WriteFlags::NO_OVERWRITE,
)?;
if initial_lease {
bytestore.lease(
lease_database,
Expand Down Expand Up @@ -1005,7 +1010,7 @@ mod local {
// The only down-side is that you need to make sure that any individual OS thread must
// not try to perform multiple write transactions concurrently. Fortunately, this
// property holds for us.
.set_flags(NO_SYNC | NO_TLS)
.set_flags(EnvironmentFlags::NO_SYNC | EnvironmentFlags::NO_TLS)
// 2 DBs; one for file contents, one for leases.
.set_max_dbs(2)
.set_map_size(MAX_LOCAL_STORE_SIZE_BYTES)
Expand Down