-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: separate auto_increment ID allocator from _tidb_rowid allocator when AUTO_ID_CACHE=1 #39041
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-unit-test |
2 similar comments
/run-unit-test |
/run-unit-test |
/run-check-dev-2 |
/run-check_dev_2 |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #982
Problem Summary:
In the past, both _row_id and auto_increment_id share the same allocator, so the behaviour is not compatible with MySQL.
We try to solve it in the past #20708, but that increase the risk of been incompatible to the old TiDB. So we mark it as won't fix. (I have to mention that clustered index relieve some of the cases, and clustered index is enabled by default now, through it does not solve all the issues)
Now we are trying to introduce a MySQL-compatible mode #38449, this is a good time to fix the behaviour. With table option
AUTO_ID_CACHE 1
, the new implementation is used.What is changed and how it works?
Seperate auto_increment ID allocator from _tidb_rowid allocator oinly when table option AUTO_ID_CACHE=1 is used.
create table ... AUTO_ID_CACHE 1 ...
decides whether to useSepAutoInc
by checking AutoIdCache and Version in model.TableInfoAllocators.Get()
findSepAutoInc
is not set, it changesAutoIncrementID
toRowID
; otherwiseAutoIncrementID
is usedCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.