executor: fix load data losing connection when batch_dml_size is set (#22724)#22736
Conversation
|
/run-all-tests |
|
@guo-shaoge please accept the invitation then you can push to the cherry-pick pull requests. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
0a6d0f8 to
1b818fa
Compare
|
lgtm |
|
/merge |
|
Sorry @XuHuaiyu, this branch's release version is in progress, please contact zhouqiang-cl,shuke987,jebter,you06 for more details. |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 88b8ae1 |
|
@ti-srebot: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
cherry-pick #22724 to release-4.0
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/22736After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Issue Number: Fix #22540
Problem Summary:
When tidb_dml_batch_size is a relatively small(eg: 128/64), load data into a table which has a auto_random column may got lost connection error.
What is changed and how it works?
What's Changed:
How it Works:
load data use two routine:
Commit routine will invalid txn after task is committed. And before generate a new txn, process stream routine may use that invalid txn to generate audo random value. So we add a lock to protect txn, make sure process stream routine use a valid txn.
Related changes
Check List
Tests
Side effects
Release note