-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Bug Report
We made a cut-over to TiDB
The table is Messages table with Auto increment on "ID"
to maintain the ID sequence the table was created with "auto_id_cache" as below
**) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=730234878 /T![auto_id_cache] AUTO_ID_CACHE=1 /
In the MySQL last sequence was "14609942" but in TiDB ID was incremented by a vast number "730170668" pl find as below
mysql> select id,updatedAt from messages where id >=14609942 limit 10;
+-----------+------------+
| id | updatedAt |
+-----------+------------+
| 14609942 | 1729291247 | ----> MySQL
| 730170668 | 1729313914 | -----> TIDB
| 730170669 | 1729313914 |
| 730170670 | 1729313914 |
| 730170671 | 1729313914 |
| 730170672 | 1729313914 |
| 730170673 | 1729313914 |
| 730170674 | 1729313914 |
| 730170675 | 1729313914 |
| 730170676 | 1729313914 |
+-----------+------------+
the TIDB has added or incremented the value on its own, This is a critical bug making TiDB unusable in production
1. Minimal reproduce step (Required)
1,Create the table structure same as MySQL also have auto_id_cache=1 to maintain compatibility.
2, Migrate the data to TiDB using DM and setup replication. till this point ID would be matching
3, Stop or Pause the DM
4, Point the application directly to use TiDB, you can see a huge jump in auto increment value.
2. What did you expect to see? (Required)
we expected the same sequence to be continue with TiDB, making it compatible
3. What did you see instead (Required)
we see a complete new ID sequence has been introduced, breaking the application
4. What is your TiDB version? (Required)
Release Version: v8.1.1
Edition: Community
Git Commit Hash: a7df4f9
Git Branch: HEAD
UTC Build Time: 2024-08-22 05:49:03
GoVersion: go1.21.13
Race Enabled: false
Check Table Before Drop: false
Store: tikv