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

release-2.1: c-deps: fix an infinite loop in MVCCScan #33065

Merged
merged 1 commit into from Dec 12, 2018

Conversation

Projects
None yet
3 participants
@petermattis
Copy link
Contributor

petermattis commented Dec 12, 2018

Backport 1/1 commits from #33063.

/cc @cockroachdb/release


MVCCScan would previously loop forever if asked to scan more than 2GB of
data. The root problem was in the calculation of the next buffer size to
use in chunkedBuffer::put which was not accounting for an int being
a signed 32-bit value. Changed the logic in chunkedBuffer::put to use
a maximum buffer size of 128 MB to avoid hitting this problem and avoid
wasting excessive space wasteage if only a tiny bit of additional space
is needed.

Fixes #32896

Release note (bug fix): Fix an infinite loop in a low-level scanning
routine that could be hit in unusual circumstances.

c-deps: fix an infinite loop in MVCCScan
MVCCScan would previously loop forever if asked to scan more than 2GB of
data. The root problem was in the calculation of the next buffer size to
use in `chunkedBuffer::put` which was not accounting for an `int` being
a signed 32-bit value. Changed the logic in `chunkedBuffer::put` to use
a maximum buffer size of 128 MB to avoid hitting this problem and avoid
wasting excessive space wasteage if only a tiny bit of additional space
is needed.

Fixes #32896

Release note (bug fix): Fix an infinite loop in a low-level scanning
routine that could be hit in unusual circumstances.

@petermattis petermattis requested review from benesch and tbg Dec 12, 2018

@petermattis petermattis requested a review from cockroachdb/core-prs as a code owner Dec 12, 2018

@cockroach-teamcity

This comment has been minimized.

Copy link
Member

cockroach-teamcity commented Dec 12, 2018

This change is Reviewable

@petermattis petermattis merged commit 0c87b11 into cockroachdb:release-2.1 Dec 12, 2018

2 checks passed

GitHub CI (Cockroach) TeamCity build finished
Details
license/cla Contributor License Agreement is signed.
Details

@petermattis petermattis deleted the petermattis:backport2.1-33063 branch Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment