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

db: strictly enforce prefix in internalIterator.SeekPrefixGE #3794

Open
jbowens opened this issue Jul 26, 2024 · 0 comments
Open

db: strictly enforce prefix in internalIterator.SeekPrefixGE #3794

jbowens opened this issue Jul 26, 2024 · 0 comments

Comments

@jbowens
Copy link
Collaborator

jbowens commented Jul 26, 2024

We should tighten the internal iterator interface to require that if SeekPrefixGE returns a key, the key is guaranteed to have the provided prefix. Every key we avoid propagating up the iterator stack avoids a key comparison during initialization of the merging iterator heap. Some code already requires that SeekPrefixGE strict, necessitating the ToplevelIterator interface with its separate SeekPrefixGEStrict method. Enforcing the prefix at the leaves will simplify this.

In columnar blocks, enforcing the prefix strictly comes for free because we must first compare against the prefix alone.

https://cockroachlabs.slack.com/archives/CAC6K3SLU/p1721918197337849

Jira issue: PEBBLE-228

jbowens added a commit to jbowens/pebble that referenced this issue Jul 26, 2024
Every key we avoid propagating up the iterator stack avoids a key comparison
during initialization of the merging iterator heap.

Informs cockroachdb#3794.
jbowens added a commit to jbowens/pebble that referenced this issue Jul 26, 2024
Every key we avoid propagating up the iterator stack avoids a key comparison
during initialization of the merging iterator heap.

Informs cockroachdb#3794.
jbowens added a commit to jbowens/pebble that referenced this issue Jul 26, 2024
Every key we avoid propagating up the iterator stack avoids a key comparison
during initialization of the merging iterator heap.

Informs cockroachdb#3794.
jbowens added a commit that referenced this issue Jul 26, 2024
Every key we avoid propagating up the iterator stack avoids a key comparison
during initialization of the merging iterator heap.

Informs #3794.
@nicktrav nicktrav moved this from Incoming to Next in [Deprecated] Storage Jul 30, 2024
RaduBerinde added a commit to RaduBerinde/pebble that referenced this issue Aug 12, 2024
This commit adds `SeekPrefixGE` assertions verifying that the `prefix`
actually is the prefix for the `key`. This was not always the case so
the offending code paths are adjusted.

In the future, we should create a wrapper iterator that verifies this
sort of thing.

Informs cockroachdb#3794
RaduBerinde added a commit to RaduBerinde/pebble that referenced this issue Aug 13, 2024
This commit adds `SeekPrefixGE` assertions verifying that the `prefix`
actually is the prefix for the `key`. This was not always the case so
the offending code paths are adjusted.

In the future, we should create a wrapper iterator that verifies this
sort of thing.

Informs cockroachdb#3794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

2 participants