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

In the member function ParseNextKey() of the Block::Ite class in the leveldb/table/block.cc file, the last member variable restart_index_ updated. #1138

Open
LunarStore opened this issue Aug 4, 2023 · 1 comment

Comments

@LunarStore
Copy link

In the leveldb/table/block.cc file, the member function ParseNextKey() of the Block::Ite class, when updating the member variable restart_index_, the last judgment condition of the while loop (GetRestartPoint(restart_index_ + 1) < current_) should be added with an equal sign, right? If the first KV of the restart point is read without the equal sign, the restart_index will not be updated in time, and the second KV must be read to update.

@zjs1224522500
Copy link

Yes, you are right! The restart_index is not be updated in time for the first entry, but I found it had little effect.

I'm not sure if introduce any new bugs when we make changes to this condition (GetRestartPoint(restart_index_ + 1) < current_). Perhaps you can run some tests to verify that it is correct and create a PR.

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

No branches or pull requests

2 participants