Skip to content
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

Duplicate entry when using BR to restore a AUTO_ID_CACHE=1 table #44716

Closed
tiancaiamao opened this issue Jun 16, 2023 · 2 comments · Fixed by #44743
Closed

Duplicate entry when using BR to restore a AUTO_ID_CACHE=1 table #44716

tiancaiamao opened this issue Jun 16, 2023 · 2 comments · Fixed by #44743

Comments

@tiancaiamao
Copy link
Contributor

tiancaiamao commented Jun 16, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tiup playground --tiflash 0
mysql -h 127.0.0.1 -u root -P 4000
create table t (a int primary key auto_increment, b int) AUTO_ID_CACHE 1;
insert into t(b) values (1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t(b) values (11),(21),(31),(41),(51),(61),(71),(81),(91);
...

tiup br backup full --pd=127.0.0.1:2379 -s local:///tmp/tidb/backup/tidb-test
# Ctrl + C to kill the playground cluster, and start a new one
tiup playground --tiflash 0

tiup br restore full --pd=127.0.0.1:2379 -s local:///tmp/tidb/backup/tidb-test

# insert data to the BR restored table
mysql -h 127.0.0.1 -u root -P 4000
use test
insert into t (b)  values  (666)

2. What did you expect to see? (Required)

No error

3. What did you see instead (Required)

mysql> insert into t (b) values (666);
ERROR 1062 (23000): Duplicate entry '1' for key 't.PRIMARY'

4. What is your TiDB version? (Required)

7.1

@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Jun 16, 2023
@tiancaiamao tiancaiamao added sig/sql-infra SIG: SQL Infra and removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-5.1 This bug maybe affects 5.1.x versions. labels Jun 16, 2023
@tiancaiamao
Copy link
Contributor Author

AUTO_ID_CACHE=1 is introduced in v6.4, this bug affect that version above.

@bolt-leandro
Copy link

Thanks for opening this bug! Looking forward to a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants