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

bulk: perform meta lookup on range cache miss during index backfill #86492

Merged

Conversation

nvanbenschoten
Copy link
Member

Fixes #84290.

This commit addresses the sustained slowdown described in #84290 by replacing
the call in SSTBatcher.flushIfNeeded to RangeCache.GetCached with a call to
RangeCache.Lookup. The former method checks the cache but returns no range
descriptor if the cache currently has no overlapping key. This is possible if
the descriptor was recently evicted because it was stale. The later method
performs a meta lookup if the cache currently has no overlapping key, so it
should always return some range descriptor.

There's a question of whether we should be logging a warning but proceeding if
this meta lookup fails. For now, I've decided not to change that behavior.

Release justification: None. Don't merge yet.

@nvanbenschoten nvanbenschoten requested a review from dt August 19, 2022 21:39
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner August 19, 2022 21:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@dt
Copy link
Member

dt commented Aug 19, 2022

I'd argue we can release justify it as bug fix in existing functionality

@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/sstBatcherMetaLookup branch from 15d7e4d to 56ab0a3 Compare September 16, 2022 21:18
Fixes cockroachdb#84290.

This commit addresses the sustained slowdown described in cockroachdb#84290 by replacing
the call in `SSTBatcher.flushIfNeeded` to `RangeCache.GetCached` with a call to
`RangeCache.Lookup`. The former method checks the cache but returns no range
descriptor if the cache currently has no overlapping key. This is possible if
the descriptor was recently evicted because it was stale. The later method
performs a meta lookup if the cache currently has no overlapping key, so it
should always return _some_ range descriptor.

There's a question of whether we should be logging a warning but proceeding if
this meta lookup fails. For now, I've decided not to change that behavior.

Release justification: None. Don't merge yet.
@nvanbenschoten
Copy link
Member Author

TFTR! Merging on master for now without an immediate backport. Will wait on the backport for a v22.2 patch release.

bors r=dt

@craig
Copy link
Contributor

craig bot commented Sep 20, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 21, 2022

Build succeeded:

@craig craig bot merged commit a25a8b0 into cockroachdb:master Sep 21, 2022
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/sstBatcherMetaLookup branch September 22, 2022 16:27
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

Successfully merging this pull request may close these issues.

bulk: range cache miss during index backfill causes sustained slowdown
3 participants