pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.88k stars 5.81k forks source link

ALTER DATABASE SET TIFLASH REPLICA will create a separate DDL job for each table inside #54275

Open D3Hunter opened 2 months ago

D3Hunter commented 2 months ago

Enhancement

ALTER DATABASE SET TIFLASH REPLICA will create a separate DDL job for each table inside, and they all share the same query, if we replicate from TiDB -> TiDB using binlog, from the view of it, they are different DDL and executed all of them in downstream, it causes N^2 such DDL jobs at downstream, suppose there are N tables for the database.

TiCDC should have same issue in theory.

we should create 1 job for a single DDL.

Frank945946 commented 2 months ago

TiCDC will filter out this DDL, so TiCDC will not encounter this issue.