release-22.1: sql: fix auto-retries for upgraded transactions #84593
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 1/1 commits from #84389 on behalf of @rafiss.
/cc @cockroachdb/release
This is implemented by adding more state to the conn executor state
machine. Now, it tracks if the open transaction was upgraded from an
implicit to an explicit txn. If so, when doing an auto retry, the
transaction is marked as an implicit again, so that the statements in
the transaction can upgrade it to explicit.
No release note is needed for v22.2, but we should use the following
note when backporting to v22.1.
Placeholder note (bug fix): Fixed a bug where some statements in a batch
would not get executed if the following conditions were met:
is set to true. (This defaults to false in v22.1.x)
This bug was introduced in v22.1.2. (#82681)
Release note: None
Release justification: bug fix