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: avoid loading later files for a level in SeekPrefixGE #3575

Closed
sumeerbhola opened this issue May 2, 2024 · 0 comments · Fixed by #3615
Closed

db: avoid loading later files for a level in SeekPrefixGE #3575

sumeerbhola opened this issue May 2, 2024 · 0 comments · Fixed by #3615

Comments

@sumeerbhola
Copy link
Collaborator

In levelIter.SeekPrefixGE we do loadFileIndicator := l.loadFile(l.findFileGE(key, flags), +1) which does not care about the prefix (in CockroachDB, these MVCCGet iterators don't have bounds set), so can load an arbitrarily later file in the level. This is something we should optimize, since there could be gaps in levels which are causing us to unnecessarily load files. This is likely to be true for CockroachDB local keys, including locks and intents which we always try to read, since that part of the key space is very sparse.

(noticed due to cockroachdb/cockroach#123313 where we had a failed read of an AbortSpanKey due to slow shared storage file read, even though the AbortSpanKey is a replicated range-id local key, so will never be in a shared storage file)

@blathers-crl blathers-crl bot added this to Incoming in Storage May 2, 2024
@nicktrav nicktrav moved this from Incoming to Backlog in Storage May 7, 2024
jbowens added a commit to jbowens/pebble that referenced this issue May 13, 2024
Don't load arbitrarily later files during levelIter.SeekPrefixGE. This avoids
unnecessary IO and CPU overhead.

Close cockroachdb#3575.
jbowens added a commit to jbowens/pebble that referenced this issue May 14, 2024
Don't load arbitrarily later files during levelIter.SeekPrefixGE. This avoids
unnecessary IO and CPU overhead.

Close cockroachdb#3575.
jbowens added a commit to jbowens/pebble that referenced this issue May 15, 2024
Don't load arbitrarily later files during levelIter.SeekPrefixGE. This avoids
unnecessary IO and CPU overhead.

Close cockroachdb#3575.
jbowens added a commit to jbowens/pebble that referenced this issue May 15, 2024
Don't load arbitrarily later files during levelIter.SeekPrefixGE. This avoids
unnecessary IO and CPU overhead.

Close cockroachdb#3575.
jbowens added a commit that referenced this issue May 15, 2024
Don't load arbitrarily later files during levelIter.SeekPrefixGE. This avoids
unnecessary IO and CPU overhead.

Close #3575.
Storage automation moved this from Backlog to Done May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Storage
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant