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
sql: make tests error if a leaf txn is not created when expected #112726
sql: make tests error if a leaf txn is not created when expected #112726
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
There was a problem hiding this 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 r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rharding6373)
pkg/sql/distsql_running.go
line 899 at r1 (raw file):
return } if buildutil.CrdbTestBuild && txn != nil && localState.MustUseLeaf && flow.GetFlowCtx().Txn.Type() != kv.LeafTxn {
I think localState.MustUseLeaf
is a function.
This adds a test-only error if a leaf transaction is expected to be used by a plan but a root transaction is used instead. Epic: none Informs: cockroachdb#111097 Release note: None
2ef4e54
to
a40a557
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @yuzefovich)
pkg/sql/distsql_running.go
line 899 at r1 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
I think
localState.MustUseLeaf
is a function.
It's a bool, but I suppose it wouldn't hurt to change this check to use the function, so I've done so.
There was a problem hiding this 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, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @rharding6373)
pkg/sql/distsql_running.go
line 899 at r1 (raw file):
Previously, rharding6373 (Rachael Harding) wrote…
It's a bool, but I suppose it wouldn't hurt to change this check to use the function, so I've done so.
Oh, right, I was thinking about localState.MustUseLeafTxn()
.
bors r+ |
Build succeeded: |
This adds a test-only error if a leaf transaction is expected to be used by a plan but a root transaction is used instead.
Epic: none
Informs: #111097
Release note: None