Unable to Update Unique Key After Incremental Synchronization from TiDB 5.2.1 to TiDB 6.1.0 via CDC

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB5.2.1 通过cdc增量同步到TiDB 6.1.0后无法更新唯一键

| username: leopardxu

[TiDB Usage Environment] Incremental Data Migration in Production Environment
[TiDB Version] From v5.2.1 to v6.1.0
[Reproduction Steps]
Follow the official steps:

  1. Create an S3 bucket
  2. Stop GC
  3. Backup tables from TiDB 5.2.1 to S3
  4. Restore data to TiDB v6.1.2
  5. Incremental synchronization using ticdc (latest version)
  6. Enable GC
    [Encountered Issues: Symptoms and Impact]
    The unique key of the table in TiDB v6.1.2 cannot be updated and cannot be used as a query condition

[Resource Configuration]
mysql> select * from sys_user where emp_id=“w123456”;
Empty set (0.00 sec)

mysql> select * from sys_user where user_name=“demo”;
id | emp_id | user_name

| 1 | w123456 | demo

mysql> desc sys_user;
±----------------±--------------------±-----±-----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±----------------±--------------------±-----±-----±--------±---------------+
| id | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
| emp_id | varchar(60) | NO | UNI | | |
| user_name | varchar(60) | NO | | | |
| mobile | varchar(20) | NO | | | |

| username: 我是咖啡哥 | Original post link

Could it be an issue with the index? Try rebuilding the index and see if it helps. I encountered a similar situation once in Oracle before.

| username: leopardxu | Original post link

Rebuilding the index solved it.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.