tidb
tidb copied to clipboard
execution: commit the transaction before responding explain analyze results to the client (#38044)
cherry-pick #38044 to release-5.4 You can switch your code base to this Pull Request by using git-extras:
# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/38060
After apply modifications, you can push your change to this PR via:
git push [email protected]:ti-srebot/tidb.git pr/38060:release-5.4-b0e073478ffe
What problem does this PR solve?
Issue Number: close #37373
Problem Summary: The explain analyze statement execution with DML executors may respond to the client before the transaction commit finishing.
What is changed and how it works?
Trigger the commit operation if the statement is an explain analyze
statement with DML executors before returning the record set of itself.
Check List
Tests
- [x] Unit test
- [ ] Integration test
- [x] Manual test (add detailed scripts or steps below)
- Sleep before the commit
- Execute explain analyze
- Check if it responses before the commit has finished
- [ ] No code
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Fix the issue explain analyze with DML executors may respond to the client before the transaction commit has finished.
[REVIEW NOTIFICATION]
This pull request has been approved by:
- ekexium
- zyguan
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer
in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer
in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
/run-all-tests
There are still some conflicts.
@MyonKeminta Conflicts are resolved, PTAL
/merge
This pull request has been accepted and is ready to merge.
@MyonKeminta Conflicts are resolved, PTAL
We have to use the old version of testkit.
/merge
This pull request has been accepted and is ready to merge.
@cfzjywxk PTAL
[2022-09-23T09:44:19.618Z] planner/core/integration_test.go:19: File is not `goimports`-ed (goimports)
[2022-09-23T09:44:19.618Z] "fmt"
/merge
This pull request has been accepted and is ready to merge.
/merge
/run-unit-test