-
Notifications
You must be signed in to change notification settings - Fork 423
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
Trying to access a table file deleted by compaction process #78
Comments
AlanVerbner
changed the title
File deleted by compaction process
Trying to access a table file deleted by compaction process
Sep 6, 2017
AlanVerbner
added a commit
to input-output-hk/mantis
that referenced
this issue
Sep 13, 2017
AlanVerbner
added a commit
to input-output-hk/mantis
that referenced
this issue
Sep 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! First I would like to thank you for your lib. It's great and we are heavily using it in our Scala based ethereum client called Mantis.
Sometimes we are experiencing an error while querying for a key:
RuntimeException: Could not open table
. I'm attaching an issue description (including logs) and a proposed solution. We would love to push our fix and create a PR if you want to.Description
When reading from DB, it seems that it's trying to open a file that was already deleted as it was marked as obsolete.
How to reproduce
Unfortunately we are not able to reproduce this error on a deterministic test as it seems to be due to a race condition error. That being said, we found that when stressing the database (reads and writes) it happens more often.
Sample Log
We have added some leveldb logs. Some examples:
Proposed fix
We think the issue is because in a concurrent modification, current version is being changed and previous files are not being retained https://github.com/dain/leveldb/blob/master/leveldb/src/main/java/org/iq80/leveldb/impl/DbImpl.java#L614 and when deleting obsolete files, a file being about to be read is deleted https://github.com/dain/leveldb/blob/master/leveldb/src/main/java/org/iq80/leveldb/impl/DbImpl.java#L285
The text was updated successfully, but these errors were encountered: