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

Encounter Duplicated entry error after pitr with non-primary-key table. #46520

Closed
3pointer opened this issue Aug 30, 2023 · 4 comments · Fixed by #46521
Closed

Encounter Duplicated entry error after pitr with non-primary-key table. #46520

3pointer opened this issue Aug 30, 2023 · 4 comments · Fixed by #46521
Labels
affects-6.5 affects-7.1 component/br This issue is related to BR of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@3pointer
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. starts a new cluster: tiup playground --tiflash=0
  2. starts log backup
  3. create table that doesn't not have primary key(make tidb use _tidb_rowid)
    e.g. create table test.test(id int);
  4. create a new full backup
  5. put some data make _tidb_rowid increased. :alter table test.test auto_increment=90001; insert into test.test values();
  6. wait log backup checkpoint synced.
  7. starts a new cluster for restore.
  8. create some irrelevant tables and drop them( make this cluster table_id increased. so that next time restore will rewrite table prefix.
  9. starts restore and check the next_row_id for table: show table test.test next_row_id.

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

image

3. What did you see instead (Required)

_tidb_rowid not updated. one workaround is use alter table test.test auto_increment=120001; to set it correctly.
image

4. What is your TiDB version? (Required)

master

@3pointer 3pointer added the type/bug The issue is confirmed as a bug. label Aug 30, 2023
@BornChanger
Copy link
Contributor

BornChanger commented Aug 30, 2023

/label component/br

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 30, 2023

@BornChanger: The label(s) component/backup-restore cannot be applied. These labels are supported: fuzz/sqlancer, challenge-program, compatibility-breaker, first-time-contributor, contribution, require-LGT3, good first issue, correctness, duplicate, proposal, security, needs-more-info, needs-cherry-pick-release-5.3, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.0, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.2, needs-cherry-pick-release-6.3, needs-cherry-pick-release-6.4, needs-cherry-pick-release-6.5, needs-cherry-pick-release-6.6, needs-cherry-pick-release-7.0, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.2, needs-cherry-pick-release-7.3, affects-5.3, affects-5.4, affects-6.0, affects-6.1, affects-6.2, affects-6.3, affects-6.4, affects-6.5, affects-6.6, affects-7.0, affects-7.1, affects-7.2, affects-7.3, may-affects-5.3, may-affects-5.4, may-affects-6.0, may-affects-6.1, may-affects-6.2, may-affects-6.3, may-affects-6.4, may-affects-6.5, may-affects-6.6, may-affects-7.0, may-affects-7.1, may-affects-7.2, may-affects-7.3.

In response to this:

/label component/backup-restore

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Aug 30, 2023

@BornChanger: The label(s) component/br cannot be applied. These labels are supported: fuzz/sqlancer, challenge-program, compatibility-breaker, first-time-contributor, contribution, require-LGT3, good first issue, correctness, duplicate, proposal, security, needs-more-info, needs-cherry-pick-release-5.3, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.0, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.2, needs-cherry-pick-release-6.3, needs-cherry-pick-release-6.4, needs-cherry-pick-release-6.5, needs-cherry-pick-release-6.6, needs-cherry-pick-release-7.0, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.2, needs-cherry-pick-release-7.3, affects-5.3, affects-5.4, affects-6.0, affects-6.1, affects-6.2, affects-6.3, affects-6.4, affects-6.5, affects-6.6, affects-7.0, affects-7.1, affects-7.2, affects-7.3, may-affects-5.3, may-affects-5.4, may-affects-6.0, may-affects-6.1, may-affects-6.2, may-affects-6.3, may-affects-6.4, may-affects-6.5, may-affects-6.6, may-affects-7.0, may-affects-7.1, may-affects-7.2, may-affects-7.3.

In response to this:

/label component/br

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@3pointer
Copy link
Contributor Author

3pointer commented Sep 8, 2023

the issue may related to #46578 if the table is not using auto-id-cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 affects-7.1 component/br This issue is related to BR of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants