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

release-2.0: storage/engine: invalidate cached iterator state when necessary #28798

Merged
merged 1 commit into from Aug 18, 2018

Conversation

petermattis
Copy link
Collaborator

Backport 1/1 commits from #28794.

/cc @cockroachdb/release


Iterator.{MVCCGet,MVCCScan,FindSplitKey,ComputeStats} need to
invalidate the cached iterator state. They were previously failing to do
so which could lead to rare scenarios where a key could be considered
present in the database which had never been written.

Fixes #28025

Release note (bug fix): Fix rare scenario where the value written for
one system key was seen when another system key was read leading to the
violation of internal invariants.

@petermattis petermattis requested review from benesch and a team August 18, 2018 19:44
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@benesch benesch left a comment

Choose a reason for hiding this comment

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

:lgtm: modulo the test compilation failure

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)


pkg/storage/engine/mvcc_test.go, line 1329 at r1 (raw file):

				_, _, _, err = MVCCScan(ctx, batch, key, roachpb.KeyMax, math.MaxInt64, ts2, true, nil)
			case "findSplitKey":
				_, err = MVCCFindSplitKey(ctx, batch, roachpb.RKeyMin, roachpb.RKeyMax, 64<<20)

Looks like this function takes an additional final allowMeta2Splits param on 2.0.

`Iterator.{MVCCGet,MVCCScan,FindSplitKey,ComputeStats}` need to
invalidate the cached iterator state. They were previously failing to do
so which could lead to rare scenarios where a key could be considered
present in the database which had never been written.

Fixes cockroachdb#28025

Release note (bug fix): Fix rare scenario where the value written for
one system key was seen when another system key was read leading to the
violation of internal invariants.
@petermattis
Copy link
Collaborator Author

bors r=benesch

craig bot pushed a commit that referenced this pull request Aug 18, 2018
28798: release-2.0: storage/engine: invalidate cached iterator state when necessary r=benesch a=petermattis

Backport 1/1 commits from #28794.

/cc @cockroachdb/release

---

`Iterator.{MVCCGet,MVCCScan,FindSplitKey,ComputeStats}` need to
invalidate the cached iterator state. They were previously failing to do
so which could lead to rare scenarios where a key could be considered
present in the database which had never been written.

Fixes #28025

Release note (bug fix): Fix rare scenario where the value written for
one system key was seen when another system key was read leading to the
violation of internal invariants.


Co-authored-by: Peter Mattis <petermattis@gmail.com>
@craig
Copy link
Contributor

craig bot commented Aug 18, 2018

Build succeeded

@craig craig bot merged commit fc0bdd1 into cockroachdb:release-2.0 Aug 18, 2018
@petermattis petermattis deleted the backport2.0-28794 branch August 19, 2018 00:08
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.

None yet

3 participants