-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
duplicateIssues or pull requests already exists.Issues or pull requests already exists.may-affects-5.4This bug maybe affects 5.4.x versions.This bug maybe affects 5.4.x versions.may-affects-6.1may-affects-6.5may-affects-7.1may-affects-7.5may-affects-8.1severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
- apply tidb code, check detail code from when leader switch, autoid service does not reset the map #52600. So we can reassign auto_id service leader
- setup tidb cluster(2 tidb/1 tikv/1 pd)
- By running following command to make sure auto_id leader is in tidb-0(10080). (command result is 'not owner')
curl http://127.0.0.1:10081/autoid/leader/resign
result: not owner
- run the following sql to create table:
create table t (id int primary key auto_increment, k int) auto_id_cache = 1;
insert into t (k) values (1);
insert into t (k) values (2);
insert into t (k) values (3);
insert into t (k) values (5);
- reassign autoid leader to tidb-1(10081). (the result of the command should be success)
curl http://127.0.0.1:10080/autoid/leader/resign
- run the following sqls to insert again:
insert into t (k) values (6);
insert into t (k) values (7);
insert into t (k) values (8);
- tiup restart tidb-1(10081)
- tiup restart tidb-0(10080)
- run the following sqls to insert 4000 lines: t.txt
source /home/guojiangtao/work/tidb/t.txt;
2. What did you expect to see? (Required)
insert runs ok
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.1.0-alpha-1-g42f4a3133d
Edition: Community
Git Commit Hash: 42f4a3133d8cc5309a5fa4dd7c92a2a1cfa3cbca
Git Branch: debug_autoid
UTC Build Time: 2024-05-01 06:19:47
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.009 sec)
bb7133
Metadata
Metadata
Assignees
Labels
duplicateIssues or pull requests already exists.Issues or pull requests already exists.may-affects-5.4This bug maybe affects 5.4.x versions.This bug maybe affects 5.4.x versions.may-affects-6.1may-affects-6.5may-affects-7.1may-affects-7.5may-affects-8.1severity/majorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.