-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Cannot get auto-id in retry 'INSERT INTO ... SELECT FROM' #20629
Comments
The description is impressive. |
Please edit this comment to complete the following informationBug1. Root Cause Analysis (RCA) (optional)When executing 2. Symptom (optional)TiDB reports 3. All Trigger Conditions (optional)
4. Workaround (optional)Retry the statement in application. 5. Affected versions[v3.0.0:v3.0.19], [v4.0.0:v4.0.8] 6. Fixed versionsv4.0.9 |
The values in ( FixedVersions ) fields are incorrect. |
1 similar comment
The values in ( FixedVersions ) fields are incorrect. |
@tangenta please cherry-pick the bugfix to the release branches. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Initialization:
Session1, Session2 execute for 100 times:
Session3 executes for 100 times:
When these sessions run concurrently:
(null, 1, %d)
. This triggers the transaction retry.auto_increment
ids are allocated before conflicts. They are reused in the following retry.src
keep increasing, the auto ids that allocated before conflicts are not enough in retry. As a result, anindex-out-of-range
error is converted toCannot get auto-id in retry
.The complete test code
2. What did you expect to see? (Required)
All of these statements should encounter no error.
3. What did you see instead (Required)
release-3.0:
release-4.0/master
4. What is your TiDB version? (Required)
All of the TiDB versions.
The text was updated successfully, but these errors were encountered: