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

storage prefix iter: skip keys that don't match the full prefix segments #1633

Closed
tzemanovic opened this issue Jun 30, 2023 · 0 comments · Fixed by #1642
Closed

storage prefix iter: skip keys that don't match the full prefix segments #1633

tzemanovic opened this issue Jun 30, 2023 · 0 comments · Fixed by #1642
Labels

Comments

@tzemanovic
Copy link
Member

The prefix iter functions in the DB (both mock and rocksdb) currently also match keys that contain extra characters in the last segment of the prefix. E.g. iter prefix "a" would match "a/sub" and also "ab/sub". This is inconsistent with the prefix iterator that are not yet committed from the write log and also with the storage::Key::split_prefix function where only "a/sub" would be matched.

To make these consistent, the prefix matching logic in the DB should add a trailing slash to the prefix to avoid matching prefixes with extra characters.

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

Successfully merging a pull request may close this issue.

1 participant