CDC Data Desynchronization

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

Original topic: cdc 数据不同步

| username: liujun6315

[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
Using BR to back up a single table and restore it to the disaster recovery database cluster, then using CDC to create a synchronization task. The synchronization status appears normal, but the disaster recovery database does not have the new data.

Synchronization table information
image

BR Backup

BR Restore

Create Synchronization Task

Check Synchronization Status
image


[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: Jellybean | Original post link

If you use CDC for synchronization, only the rows in TiKV that have changes will generate change logs. Try performing write operations on the table after backup and restore; it should be able to synchronize at that time.

| username: liujun6315 | Original post link

The primary database has new data, but the secondary database has not synchronized it.

| username: WalterWj | Original post link

Take a look at the CDC monitoring, you need to wait for the resolve ts lock to be scanned completely.

| username: liujun6315 | Original post link

Some tables work, looking at the table structure, they are basically the same.

| username: liujun6315 | Original post link

The status is normal, but after the gc-ttl time has passed, the status becomes abnormal.

| username: tidb狂热爱好者 | Original post link

What is the reason for this?

| username: zhang_2023 | Original post link

I encountered it too, how did you solve it?

| username: 像风一样的男子 | Original post link

Check the logs in the cdc directory for error messages. I have encountered this before; specific issues need to be analyzed individually.

| username: liujun6315 | Original post link

Which version are you using?

| username: TiDBer_aaO4sU46 | Original post link

Is there any change in TiKV? If not, there won’t be a changelog.