-
Notifications
You must be signed in to change notification settings - Fork 163
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
retrieving all keys in db with a cursor causes subsequent cursors to not see some keys #41
Comments
I noticed this as well when I tried with 1000 records that 24 were missing (twice what @lebedov noted when testing 500 keys). Interestingly, the same keys seemed to be missing each time: key_270, key_271, key_371, key_390, key_416, key_417, key_490, key_516, key_517, key_531, key_533, key_534, key_535, key_536, key_921, key_922, key_923, key_933, key_940, key_941, key_950, key_951, key_960, key_970 |
I had been kind of hoping this was a bug in my binding rather than in UnQLite, but it appears that @lebedov reproduced it using the C APIs. This is extremely disconcerting: a key/value database may mysteriously not return keys that are actually present when iterating with a cursor. I hope you are able to follow-up on this issue soon, as I would like to warn any users of my Python bindings about this bug and potentially direct them to a more suitable database if necessary. |
Seems related to #3 and discussed also here: https://unqlite.org/forum/thread.php?file=__8 |
Be sure to test against the last patched version of the library. We have faced this issue and a patch was submitted to the Github repo. Sent from my android device. -----Original Message----- I noticed this as well when I tried with 1000 records that 24 were missing (twice what @lebedov noted when testing 500 keys). Interestingly, the same keys seemed to be missing each time: key_270, key_271, key_371, key_390, key_416, key_417, key_490, key_516, key_517, key_531, key_533, key_534, key_535, key_536, key_921, key_922, key_923, key_933, key_940, key_941, key_950, key_951, key_960, key_970 You are receiving this because you are subscribed to this thread. |
The problem still occurs when I build the test program against the latest revision in master (b87eecb). |
Same here, seeing it fail with 1.1.6 amalgamation as well. In-memory DBs seem unaffected, but DBs on the filesystem are the one's that have the issue. |
Could you send your test case Sent from my android device. -----Original Message----- The problem still occurs when I build the test program against the latest revision in master (b87eecb). You are receiving this because you commented. |
It's stupid simple. Create a database on the filesystem with 500 keys, 8byte keys, 100byte values (just to replicate what @lebedov noticed). Then close and re-open the database. After re-opening the database, use the cursor APIs to iterate through twice in a row. The first time you'll see 500...the second time you'll see somewhat less. I'm seeing 490 at the moment. Here's the Python test-case I just added (which is failing): |
Interestingly, with Vedis, after inserting 500 records I get an error on the very first iteration :/ -- even after updating my sources. |
Apparently this bug has been around since 2014? https://unqlite.org/forum/thread.php?file=__8&page=1#2hymzp2f2kfv |
Yes, since they share the same pager & transaction manager. I really suspect that layer. Sent from my android device. -----Original Message----- Interestingly, with Vedis, after inserting 500 records I get an error on the very first iteration :/ -- even after updating my sources. You are receiving this because you commented. |
Well, there's #41 (comment) which @lebedov was kind enough to share. And I've linked you to the test-case I checked into the Python bindings I wrote here. Here's the pseudocode:
|
Yes - I was using the amalgamated |
Yep, I'll merge all of that once back to the office On 18-Aug-16 15:37, Lev E. Givon wrote:
Mrad - Symisc Systems, Suarl, http://symisc.net |
It'd be nice if there was a Makefile that could be used to generate the amalgamation. |
Hi @symisc You said this issue is fixed but code is latest commit is from several months ago. Is there another repository? Thanks. |
Source Code (Amalgamation & Github) Update with the 1.1.7 release which fixes all the know bugs. |
When I run the following, the second printf displays 483 rather than 500. Removing the first while() loop that retrieves all of the keys causes the second printf to display 500. Is this expected?
I'm building the above against unqlite 1.1.6 with Apple LLVM 7.3.0 on MacOS 10.11.6.
The text was updated successfully, but these errors were encountered: