-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
- setup a cluster
tiup playground --mode tikv-slim
./bin/tidb-server -store=tikv -path=127.0.0.1
- set @@auto_increment_increment and @@auto_increment_offset global variable
set @@global.auto_increment_increment = 66;
set @@global.auto_increment_offset = 9527;
(exit the mysql client and login again to make the global variable take effect)
- create table and insert data
create table t (id int primary key auto_increment, k int) auto_id_cache = 1;
insert into t (k) values (1),(2),(3);
mysql> select * from t;
+------+------+
| id | k |
+------+------+
| 9527 | 1 |
| 9593 | 2 |
| 9659 | 3 |
+------+------+
3 rows in set (0.00 sec)
-
restart tidb
-
show create table and insert data again
show create table t;
mysql> insert into t (k) values (4);
ERROR 1062 (23000): Duplicate entry '9527' for key 't.PRIMARY'
2. What did you expect to see? (Required)
No duplicate entry error
3. What did you see instead (Required)
Duplicate entry
4. What is your TiDB version? (Required)
master
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.1.0-alpha-99-g3d82fc5be3-dirty
Edition: Community
Git Commit Hash: 3d82fc5be3a2b319de7e073e8b2b29d8f8f7ae94
Git Branch: master
UTC Build Time: 2024-04-15 14:46:06
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)