Closed rrichardson closed 5 years ago
Here is the output from lmdb Transaction::delete
---- env::tests::test_multi_put_get_del stdout ----
put [115, 116, 114, 49] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 49, 32, 102, 111, 111]
put [115, 116, 114, 49] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 49, 32, 98, 97, 114]
put [115, 116, 114, 50] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 50, 32, 102, 111, 111]
put [115, 116, 114, 50] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 50, 32, 98, 97, 114]
put [115, 116, 114, 51] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 51, 32, 102, 111, 111]
put [115, 116, 114, 51] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 51, 32, 98, 97, 114]
del [115, 116, 114, 49] [7, 8, 0, 0, 0, 0, 0, 0, 0, 115, 116, 114, 49, 32, 102, 111, 111]
thread 'env::tests::test_multi_put_get_del' panicked at 'called `Result::unwrap()` on an `Err` value: LmdbError(NotFound)', src/libcore/result.rs:1009:5
Replicated this in lmdb-rs and created a test and issue in lmdb-rs for this. https://github.com/mozilla/lmdb-rs/issues/17
This test now passes using https://github.com/mozilla/lmdb-rs/pull/18
This is fixed. @rrichardson - push this change to the upstream lmdb-rs
When deleting a single record in a
DUP_SORT
db, the result is always LmdbError::NotFound.Upon tracing the lmdb-rs-sys put and delete code, the key and value passed into both has an identical set of bytes, so I'm not sure what the hangup is. I've created a unit test that demonstrates this: https://github.com/mozilla/rkv/pull/93/files#diff-06aeb1dbfcf2eb1e00a4f7fe0edab250R488
Still not yet sure why it's failing. I guess I need to read up on LMDB docs.