Skip to content

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

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/sstBatcherMetaLookup
Sep 21, 2022
Merged

bulk: perform meta lookup on range cache miss during index backfill#86492
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/sstBatcherMetaLookup

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Aug 19, 2022

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.

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

This change is Reviewable

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

dt commented Aug 19, 2022

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

@nvb nvb 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.
@nvb nvb force-pushed the nvanbenschoten/sstBatcherMetaLookup branch from 56ab0a3 to 5a85950 Compare September 16, 2022 21:50
@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Sep 20, 2022

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
Copy Markdown
Contributor

craig bot commented Sep 20, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 21, 2022

Build succeeded:

@craig craig bot merged commit a25a8b0 into cockroachdb:master Sep 21, 2022
@nvb nvb 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