-
Notifications
You must be signed in to change notification settings - Fork 421
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
crl-release-24.1: ingest: avoid unnecessary I/O when checking overlap #3620
crl-release-24.1: ingest: avoid unnecessary I/O when checking overlap #3620
Conversation
This commit sets the upper bound on the level iterator used when checking for overlap. This avoids unnecessarily opening a file that starts after the key range of interest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @jbowens)
ingest.go
line 935 at r1 (raw file):
computeOverlapWithSpans := func(rIter keyspan.FragmentIterator) (bool, error) { // NB: The spans surfaced by the fragment iterator are non-overlapping. span, err := rIter.SeekGE(bounds.Start)
Not sure this fixes much, I think we'd still open the next file here?
ingest.go
line 1109 at r1 (raw file):
rkeyLevelIter.Init( keyspan.SpanIterOptions{}, comparer.Compare, newRangeKeyIter, v.Levels[level].Iter(), manifest.Level(level), manifest.KeyTypeRange,
should this be v.RangeKeyLevels
?
Previously, RaduBerinde wrote…
Well.. only when there's another file on the level which range keys |
Previously, RaduBerinde wrote…
*with range keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @RaduBerinde)
ingest.go
line 1109 at r1 (raw file):
Previously, RaduBerinde wrote…
should this be
v.RangeKeyLevels
?
Good catch, yeah it should be. v.Levels
is still correct since it contains a superset of the files in v.RangeKeyLevels
, but the keyspanimpl.LevelIter needs to potentially wade through many files with no range keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @jbowens)
ingest.go
line 1109 at r1 (raw file):
Previously, jbowens (Jackson Owens) wrote…
Good catch, yeah it should be.
v.Levels
is still correct since it contains a superset of the files inv.RangeKeyLevels
, but the keyspanimpl.LevelIter needs to potentially wade through many files with no range keys
I'll leave it as is here to minimize the changes. Shouldn't be a big deal, the keyspanimpl.LevelIter
will filter out files that have no range keys.
This commit sets the upper bound on the level iterator used when checking for overlap. This avoids unnecessarily opening a file that starts after the key range of interest.