db.exists? return always true
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 76
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
I found a bug in the gem when trying to check for the existence of a key right after opening the database.
Here are examples of the bug, in the IRB console :
db = RocksDB.open("db/path")
db.exists?("user:adadada") # must return false
> true
db.get("user:adadada") # must return nil
> nil
db.exists?("user:adadada") # must return false
> false
But if before asking for the existence of the key, we do an each_key or other, db.exists? works well :
db = RocksDB.open("db/path")
db.each_key { |k| puts k }
db.exists?("user:adadada") # must return false
> false
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior in IRB using RocksDB.open, exists?, get, and each_key. Start at the db.exists? entry point and compare its first call after opening with calls after iteration or get. Done means a missing key returns false immediately after opening as well as after other database operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100