Sync_diff_inspector reports the count is not correct

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

Original topic: sync_diff_inspector报错the count is not correct

| username: Geoffrey

[TiDB Usage Environment] Production
[TiDB Version] 3.0.12
[Encountered Issue: Problem Phenomenon and Impact]
Using sync_diff_inspector to check data consistency, an error occurs: the count is not correct, as shown in the image:

The version of the sync_diff_inspector tool package is 7.0.2, as shown in the image:

The TiDB version is self-built 3.0.12, and the target end is MySQL.

| username: zhouzeru | Original post link

When using the sync_diff_inspector tool to verify data consistency between TiDB and MySQL databases, an error “the count is not correct” was encountered. This situation is usually caused by differences in table structure or incompatible data types, which may require further investigation.

To resolve this issue, you can try the following steps:

  1. Check Table Structure: Verify that the table structures between TiDB and MySQL databases are completely consistent, including table names, column names, column types, and column order. If the table structures are different, you may need to adjust the structure to make the data structures between the two databases completely consistent.
  2. Check Data Types: Ensure that the data types between TiDB and MySQL databases match. If the data types do not match, you may need to perform data type conversion to make the data types between the two databases completely consistent.
  3. Check Data Volume: Verify that the data volume between TiDB and MySQL databases is consistent. If the data volume is inconsistent, you may need to perform data synchronization to make the data volume between the two databases completely consistent.
  4. Check Data Synchronization Tool: Ensure that the data synchronization tool is correctly configured and supports data synchronization between TiDB and MySQL. You can refer to the documentation of the data synchronization tool to confirm whether it supports data synchronization between TiDB and MySQL.
  5. Check TiDB and MySQL Logs: Look for relevant error information in the logs of TiDB and MySQL to better locate the problem. You can review the logs of TiDB and MySQL to confirm whether there are any issues during the data synchronization process.
| username: redgame | Original post link

Is it possible that the data source has changed between the two comparisons, such as new, modified, or deleted data? This could lead to an inconsistent row count.

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

I encountered the same error before. Setting the snapshot for the upstream and downstream databases in the configuration file resolved it.

| username: TiDBer_yyy | Original post link

What I encountered was an issue with ignoring case sensitivity of fields, resulting in the same error.

Solution: Modify the fields to match the case sensitivity of the table structure.

| username: Fly-bird | Original post link

Inconsistent?

| username: system | Original post link

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