Skip to content
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

Potential problem in RocksDBSample.java according to the description on the wiki #3864

Closed
sihuazhou opened this issue May 17, 2018 · 3 comments
Assignees
Labels

Comments

@sihuazhou
Copy link

sihuazhou commented May 17, 2018

Expected behavior

According to the wiki https://github.com/facebook/rocksdb/wiki/Iterator#error-handling, people always need to call RocksIterator#status() after Seek(), Next(), SeekToFirst(), SeekToLast(), SeekForPrev(), and Prev(), even if Valid()=true.

Actual behavior

RocksIterator#status() is only used in a few loop, that is inconsistent with the description from the wiki.

(Additional, what is the best practice with using RocksIterator and the status()?)

@adamretter
Copy link
Collaborator

adamretter commented May 17, 2018

@sihuazhou If the Wiki is correct, then it does indeed seem like RocksIterator#status() should be called more frequently.

However it seems like the behaviour might change again: #3810

@sagar0 Can you comment on whether that is the case?

@adamretter adamretter self-assigned this May 17, 2018
@StefanRRichter
Copy link

StefanRRichter commented May 17, 2018

If the wiki is actually correct, I would almost suggest that the Java API could automatically introduce the status check after all mentioned methods in RocksIterator. Otherwise this is super easy to overlook.

@adamretter
Copy link
Collaborator

@StefanRRichter I think the Wiki will have to be updated again after #3810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
@adamretter @StefanRRichter @sihuazhou and others