pingcap / tiflow

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

handle-error deal with online ddl #3479

Open GMHDBJD opened 2 years ago

GMHDBJD commented 2 years ago

Is your feature request related to a problem?

upstream

set @@sql_mode=''

pt

ALTER TABLE db.tb ADD COLUMN `expect_date` DATE NOT NULL DEFAULT 0;

dm

cannot track ddl: invalid default value 0 for `expect_date`
original ddl: rename /* gh-ost */ table `db`.`tb`` to `db`.`_tb_del`, `db`.`_tb_gho` to `db`.`tb`

Describe the feature you'd like

Though

handle-error <task> replace "ALTER TABLE `db`.`tb` ADD COLUMN `expect_date` DATE NOT NULL DEFAULT '0000-00-00';"

can replace the rename statement to alter statement, the origin online schema meta still remain in DM-worker, which may cause problem. handle-error skip/replace may need to skip/replace the origin ddl(ALTER statement) in online-ddl.

Describe alternatives you've considered

No response

Teachability, Documentation, Adoption, Migration Strategy

No response

GMHDBJD commented 2 years ago

cannot track ddl is caused by https://github.com/pingcap/tidb/issues/29795

glorv commented 2 years ago

/cc @sunzhaoyang