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
rocksdb creates LOCK and LOG files even if DB does not exist, and create_if_missing is false #5029
Comments
Thanks @gbitzes for reporting. Would you like to submit a PR to fix this? |
It's been a month and I since the OP didn't reply, I don't think they are going to submit a PR. It's a real issue, since sometimes I use The former, and in particular the latter, should "make no harm", meaning - if there's no RocksDB inside the directory, no file should be created. |
I had not noticed this issue before I submitted PR 5230 which is the same issue. |
Thanks for your fix @muralivemulapati ! Hopefully you could wrap up the change based on the comment you got there. |
Reference: #5230 |
If any of the passed RocksDB DBs to sparse_merkle_db_editor are non-existent or empty, exit with an error instead of reporting empty values. Prior to this change, the editor was first creating an empty DB and then all commands were working by reporting default/empty values. Since RocksDB doesn't offer a consistent method for checking if a DB exists at a given path, first check if the passed directory exists. If it doesn't, report an error. If it does, check if there are any keys in the DB - if there are none, report an error. Above behavior can be simplified when the following RocksDB issue is resolved: facebook/rocksdb#5029 Add tests for non-existent and empty databases for commands accepting both one and two DB paths.
If any of the passed RocksDB DBs to sparse_merkle_db_editor are non-existent or empty, exit with an error instead of reporting empty values. Prior to this change, the editor was first creating an empty DB and then all commands were working by reporting default/empty values. Since RocksDB doesn't offer a consistent method for checking if a DB exists at a given path, first check if the passed directory exists. If it doesn't, report an error. If it does, check if there are any keys in the DB - if there are none, report an error. Above behavior can be simplified when the following RocksDB issue is resolved: facebook/rocksdb#5029 Add tests for non-existent and empty databases for commands accepting both one and two DB paths.
This bug is still open |
Expected behavior
If
create_if_missing
is false, and we point rocksdb to open some non-sense location such as/etc
, rocksdb should fail to open the directory, without modifying anything inside said directory.Actual behavior
rocksdb adds files like
LOCK
,LOG
into the directory.The text was updated successfully, but these errors were encountered: