-
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
when leader switch, autoid service does not reset the map #52600
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
affects-8.1
This bug affects the 8.1.x(LTS) versions.
report/customer
Customers have encountered this bug.
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Comments
ti-chi-bot
bot
added
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
labels
Apr 15, 2024
This bug is cause by that when leader lost its leadership, it does not reset the table id => value map. |
tiancaiamao
added
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
affects-8.1
This bug affects the 8.1.x(LTS) versions.
and removed
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
labels
Apr 15, 2024
3AceShowHand
pushed a commit
to 3AceShowHand/tidb
that referenced
this issue
Apr 16, 2024
…lose for AUTO_ID_CACHE=1 (pingcap#52602) close pingcap#52600
13 tasks
13 tasks
13 tasks
17 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-6.5
This bug affects the 6.5.x(LTS) versions.
affects-7.1
This bug affects the 7.1.x(LTS) versions.
affects-7.5
This bug affects the 7.5.x(LTS) versions.
affects-8.1
This bug affects the 8.1.x(LTS) versions.
report/customer
Customers have encountered this bug.
severity/major
sig/sql-infra
SIG: SQL Infra
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
I modify the source code to provide a leader resign http api.
./bin/tidb-server -store=tikv -path=127.0.0.1:2379 -P 4000 -status 10080
./bin/tidb-server -store=tikv -path=127.0.0.1:2379 -P 4001 -status 10081
The leader is 10080 because it starts first
curl http://127.0.0.1:10080/autoid/leader/resign
insert into t (k) values (6);
insert into t (k) values (7);
insert into t (k) values (8);
mysql> select * from t;
+------+------+
| id | k |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 5 |
| 4001 | 6 |
| 4002 | 7 |
| 4003 | 8 |
+------+------+
curl http://127.0.0.1:10081/autoid/leader/resign
insert into t (k) values (9);
insert into t (k) values (10);
insert into t (k) values (11);
mysql> select * from t;
mysql> select * from t;
+------+------+
| id | k |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 5 |
| 5 | 9 |
| 6 | 10 |
| 7 | 11 |
| 4001 | 6 |
| 4002 | 7 |
| 4003 | 8 |
+------+------+
10 rows in set (0.00 sec)
2. What did you expect to see? (Required)
In the last step, the id should be 4005,4006,4007 or 8001,8002,8003
The auto id should never decrease!
3. What did you see instead (Required)
When tidb leader switch from 10080 to 10081, and back to 10080 again, the allocated autoid decrease!
The could cause a duplicate entry error
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: