tiflow icon indicating copy to clipboard operation
tiflow copied to clipboard

cdc tidb to mysql error

Open Mannoj87 opened this issue 1 year ago • 1 comments

What did you do?

Am already in 7.5v. I have setup the cdc from tidb to mysql via changefeed, ./cdc cli changefeed create --server=http://cdc_host:8300/ --sink-uri="mysql://tidb:passwrd@mysql_host:3306/" --changefeed-id="T2M" . The above one got created when I list it, Im getting below error. tidb@stg-tidb001:/tidb-deploy/cdc-8300/bin$ ./cdc cli changefeed list [ { "id": "T2M", "namespace": "default", "summary": { "state": "warning", "tso": 447584345403686922, "checkpoint": "2024-02-08 18:56:18.548", "error": { "time": "2024-02-08T19:11:25.70400378+05:30", "addr": "10.57.44.168:8300", "code": "CDC:ErrMySQLTxnError", "message": "[CDC:ErrMySQLTxnError]MySQL txn error: Error 1146 (42S02): Table 'dm_meta.task-test_syncer_checkpoint' doesn't exist" } } } ] I see the table exist in TiDB. 'dm_meta.task-test_syncer_checkpoint' -> mysql> select * from task-test_syncer_checkpoint \G *************************** 1. row *************************** id: mysql-01 cp_schema: cp_table: binlog_name: mariadb-bin.000968 binlog_pos: 497291764 binlog_gtid: 20137-1303090024-523132307 exit_safe_binlog_name: exit_safe_binlog_pos: 0 exit_safe_binlog_gtid: table_info: null is_global: 1 create_time: 2024-02-07 16:09:54 update_time: 2024-02-09 14:45:55 1 row in set (0.00 sec)

Also my question comes up, why we have binlog of another source? this binlog file name is from another source where the tidb is getting replicated from.

My idea is to get Source Mysql(A) -> TiDB (replicate) -> Mysql(B). Mysql(A) to Tidb works but not from Tidb->Mysql(B) via cdc.

What did you expect to see?

Sync should work between Tidb to Mysql

What did you see instead?

Error "message": "[CDC:ErrMySQLTxnError]MySQL txn error: Error 1146 (42S02): Table 'dm_meta.task-test_syncer_checkpoint' doesn't exist"

Versions of the cluster

Upstream TiDB cluster version (execute SELECT tidb_version(); in a MySQL client):

mysql> select version(); +--------------------+ | version() | +--------------------+ | 8.0.11-TiDB-v7.5.0 | +--------------------+ 1 row in set (0.01 sec)

Upstream TiKV version (execute tikv-server --version):

TiKV Release Version: 7.5.0 Edition: Community Git Commit Hash: bd8a0aabd08fd77687f788e0b45858ccd3516e4d Git Commit Branch: heads/refs/tags/v7.5.0 UTC Build Time: 2023-11-28 13:20:02 Rust Version: rustc 1.67.0-nightly (96ddd32c4 2022-11-14) Enable Features: pprof-fp jemalloc mem-profiling portable sse test-engine-kv-rocksdb test-engine-raft-raft-engine cloud-aws cloud-gcp cloud-azure Profile: dist_release

TiCDC version (execute cdc version):

Release Version: v7.5.0 Git Commit Hash: 8c006b38bdc304201d646c35c993156abcc2b845 Git Branch: heads/refs/tags/v7.5.0 UTC Build Time: 2023-11-20 05:31:19 Go Version: go version go1.21.3 linux/amd64 Failpoint Build: false

Mannoj87 avatar Feb 12 '24 10:02 Mannoj87

@Mannoj87 DM is used to replicate Mysql(A) to TiDB, right? The table 'dm_meta.task-test_syncer_checkpoint' in TiDB is created by DM to store the metadata of DM. I think the error "Table 'dm_meta.task-test_syncer_checkpoint' doesn't exist" might happen if you create DM task first then create cdc changefeed.

If you don't need 'dm_meta.task-test_syncer_checkpoint' to be synced to Mysql(B), you can config CDC changefeed to not sync 'dm_meta.task-test_syncer_checkpoint', by adding configuration like below to your changefeed configuration, refer to https://docs.pingcap.com/tidb/stable/ticdc-changefeed-config#changefeed-configuration-parameters for details.

[filter]
rules = ['*.*', '!dm_meta.*']

fubinzh avatar Feb 19 '24 02:02 fubinzh

Close it since there is no more update.

asddongmen avatar May 21 '24 04:05 asddongmen