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: declare correct key for QueryTxn request #23996

Merged

Conversation

nvanbenschoten
Copy link
Member

Fixes #23944.

This change corrects QueryTxn so that it now correctly declares the
key that it reads from. This is important because the previous
incorrect declaration allowed for improper CommandQueue synchronization
with other requests that touch the transaction record.

There were two approaches we could take here:

  • Map the requests header.Key to the correct key
  • Append the txnID to header.Key

This change goes with the former approach because it does not have any
compatibility concerns and because it is consistent with what we do
for PushTxn requests.

Release note: None

Fixes cockroachdb#23944.

This change corrects QueryTxn so that it now correctly declares the
key that it reads from. This is important because the previous
incorrect declaration allowed for improper CommandQueue synchronization
with other requests that touch the transaction record.

There were two approaches we could take here:
- Map the requests header.Key to the correct key
- Append the txnID to header.Key

This change goes with the former approach because it does not have any
compatibility concerns and because it is consistent with what we do
for PushTxn requests.

Release note: None
@nvanbenschoten nvanbenschoten requested review from tbg and a team March 17, 2018 21:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Mar 17, 2018
Before this change, we only performed SpanSet assertions on read-write
requests. This was a pretty huge oversight and is what allowed cockroachdb#23944 to
slip in. This change fixes this by adding a `engine.ReadWriter` spanset
variant and using it for read-only requests while in race mode.

It is currently blocked on cockroachdb#23996 and the revival of cockroachdb#18579.

Release note: None
@bdarnell
Copy link
Contributor

:lgtm:


Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

@nvanbenschoten nvanbenschoten merged commit b0a88c1 into cockroachdb:master Mar 19, 2018
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/fixSpanSet branch March 19, 2018 17:59
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Mar 19, 2018
Before this change, we only performed SpanSet assertions on read-write
requests. This was a pretty huge oversight and is what allowed cockroachdb#23944 to
slip in. This change fixes this by adding a `engine.ReadWriter` spanset
variant and using it for read-only requests while in race mode.

It is currently blocked on cockroachdb#23996 and the revival of cockroachdb#18579.

Release note: None
nvanbenschoten added a commit to nvanbenschoten/cockroach that referenced this pull request Mar 19, 2018
Before this change, we only performed SpanSet assertions on read-write
requests. This was a pretty huge oversight and is what allowed cockroachdb#23944 to
slip in. This change fixes this by adding a `engine.ReadWriter` spanset
variant and using it for read-only requests while in race mode.

It is currently blocked on cockroachdb#23996 and the revival of cockroachdb#18579.

Release note: None
craig bot added a commit that referenced this pull request Apr 5, 2018
24046: backport-2.0: storage: perform SpanSet assertions on read-only requests r=nvanbenschoten a=nvanbenschoten

Backport 1/1 commits from #23997.

/cc @cockroachdb/release

---

Before this change, we only performed SpanSet assertions on read-write
requests. This was a pretty huge oversight and is what allowed #23944 to
slip in. This change fixes this by adding an `engine.ReadWriter` spanset
variant and using it for read-only requests while in race mode.

It is currently blocked on #23996 and the revival of #18579. This is actually
good news, as it means that no other spanset violations have crept in while
this assertion was missing. 

First commit is from #23996.

Release note: None
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.

3 participants