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

storage/engine: invalidate cached iterator state when necessary #28794

Merged
merged 1 commit into from Aug 18, 2018

Conversation

petermattis
Copy link
Collaborator

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 a review from a team August 18, 2018 18:06
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@petermattis petermattis requested a review from tbg August 18, 2018 18:06
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_strong: 👏 👏 👏 👏

Assume you're planning to backport this?

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


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

			}

			// Perform a Get or Scan.

nit: "or FindSplitKey or Compute Stats". Maybe rephrase to "perform the operation"? Or maybe just drop the comment entirely.

`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.
Copy link
Collaborator Author

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

Yes, I'm planning on backporting this.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained


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

Previously, benesch (Nikhil Benesch) wrote…

nit: "or FindSplitKey or Compute Stats". Maybe rephrase to "perform the operation"? Or maybe just drop the comment entirely.

Removed. I was diligently commenting while developing and then extended the test.

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.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@petermattis
Copy link
Collaborator Author

bors r=benesch

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

`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>
@tbg
Copy link
Member

tbg commented Aug 18, 2018 via email

@craig
Copy link
Contributor

craig bot commented Aug 18, 2018

Build succeeded

@craig craig bot merged commit b1aaee4 into cockroachdb:master Aug 18, 2018
@petermattis
Copy link
Collaborator Author

Can't review now and don't wait for me, just wanted to mention that you're linking the wrong issue.

Gah! Too late!

@petermattis petermattis deleted the pmattis/ycsb-bug branch August 18, 2018 20:10
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>
@benesch
Copy link
Contributor

benesch commented Aug 19, 2018 via email

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.

sql: logic test auto-rewrite breaks EXPLAIN
4 participants