Skip to content

rangefeedcache: use unbounded buffers during initial scans#78148

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
irfansharif:220319.initial-scan-unlimited
Mar 21, 2022
Merged

rangefeedcache: use unbounded buffers during initial scans#78148
craig[bot] merged 1 commit intocockroachdb:masterfrom
irfansharif:220319.initial-scan-unlimited

Conversation

@irfansharif
Copy link
Copy Markdown
Contributor

Fixes #77687. We previously used a bounded buffer size for the rangefeed
cache's initial scan. If the size of the table being scanned is larger
than the configured limit, this is unrecoverable. A subsequent retry
would run into the same limit. This behavior can have severe negative
effects for the span configs infrastructure -- if
system.span_configurations has a few too many rows, the kvsubscriber
instantiated per-store will never be able to read from it.

This PR uses an unbounded buffer during the initial scan, and bounds the
buffer once we're in the incremental stage.

Release justification: low risk, high benefit
Release note: None

Fixes cockroachdb#77687. We previously used a bounded buffer size for the rangefeed
cache's initial scan. If the size of the table being scanned is larger
than the configured limit, this is unrecoverable. A subsequent retry
would run into the same limit. This behavior can have severe negative
effects for the span configs infrastructure -- if
`system.span_configurations` has a few too many rows, the kvsubscriber
instantiated per-store will never be able to read from it.

This PR uses an unbounded buffer during the initial scan, and bounds the
buffer once we're in the incremental stage.

Release justification: low risk, high benefit
Release note: None
@irfansharif irfansharif requested a review from ajwerner March 20, 2022 00:55
@irfansharif irfansharif requested a review from a team as a code owner March 20, 2022 00:55
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)

@irfansharif
Copy link
Copy Markdown
Contributor Author

CI failure was fixed by #78088.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 21, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 21, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 21, 2022

Build succeeded:

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.

rangefeedcache: buffer overflow on initial scan is unrecoverable

4 participants