pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
416 stars 277 forks source link

Reduce duplication of DM's syncer and CDC's MySQL sink #3242

Open lance6716 opened 2 years ago

lance6716 commented 2 years ago

noticed there're lot of functions can be reused:

(a finished item)


https://github.com/pingcap/ticdc/blob/4bc1853a10287f12aff5706123c0cfc39feae7d2/cdc/sink/mysql.go#L1203 vs https://github.com/pingcap/ticdc/blob/4bc1853a10287f12aff5706123c0cfc39feae7d2/dm/syncer/dml.go#L713


sink/causality.go vs syncer/causality.go

fatelei commented 2 years ago

can I have a try to make a pull request?

lance6716 commented 2 years ago

can I have a try to make a pull request?

thanks! we’re looking forward to your contribution.

also please keep pr in a small size, that’s better for reviewing.

fatelei commented 2 years ago

can I have a try to make a pull request?

thanks! we’re looking forward to your contribution.

also please keep pr in a small size, that’s better for reviewing.

ok

amyangfei commented 2 years ago

Causality detection is also a common library used both in DM and TiCDC. ref: https://github.com/pingcap/ticdc/issues/3286

lance6716 commented 2 years ago

some comparison of DML part of mysqlSink and Syncer

dml comes from:

processing stages:

compact

generate DML:

batch a SQL transactoin

cyclic replication

cc @amyangfei @GMHDBJD