-
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
Compatible issue when using lightning + SHARD_ROW_ID_BITS + AUTO_ID_CACHE=1 #52654
Comments
If we don't use AUTO_ID_CACHE = 1, we will get
which make senses. |
OK, I know how the bug come in. After we alloc an ID, we'll check the overflow of it: tidb/pkg/table/tables/tables.go Lines 1706 to 1726 in 7c4f4fa
But the code only check the RowID, not the AutoIncrementID... in the old code, row id and auto_increment share the same allocator. After this commit, we separate row id and auto_increment id. |
Create a table without AUTO_ID_CACHE=1, insert 1778961125641936898 report error, Because when using AUTO_ID_CACHE=1, row id and auto increment id use different allocator. |
So the problem is in step2 & step3. When we dump + lightning the database, the error occur.
When we dumpling and lightning this database, the new value is:
As you can see the _tidb_rowid changed.
|
@tiancaiamao Dumpling doesn't export _tidb_rowid, _tidb_rowid is generated by lightning, I think it is OK if the value is changed after importing. |
tidb/br/pkg/lightning/common/common.go Line 79 in aab2da0
RebaseGlobalAutoID 1778961125641936900 &{ see #46171 |
|
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
dumpling the data then drop table t and using lightning physical mode to import data.
insert into t values ()
2. What did you expect to see? (Required)
No error, because we can continues insert rows like,
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
5bb8ed7
The text was updated successfully, but these errors were encountered: