pingcap / dm

Data Migration Platform
Apache License 2.0
456 stars 188 forks source link

dm-worker lost online-ddl configuration after upgrade #2223

Closed lichunzhu closed 3 years ago

lichunzhu commented 3 years ago

What did you do?

  1. Start a dm-cluster with version <=v2.0.4.
  2. Start a task with online-ddl-schema: "pt".
  3. Upgrade dm-cluster from to >=v2.0.5.

What did you expect to see?

DM's subtask configuration online-ddl should be changed to true. DM should handle pt online ddl correctly.

What did you see instead?

DM's subtask configuration online-ddl is still false and can't handle pt online ddl any more.

Versions of the cluster

Upgrade dm from v2.0.4 to v2.0.6.

current status of DM cluster (execute query-status in dmctl)

(paste current status of DM cluster here)
lichunzhu commented 3 years ago

Root cause

We only adjust online-ddl for newly created tasks at https://github.com/pingcap/dm/blob/d2dc22d/dm/config/task.go#L449. For subtasks created after a upgrade we didn't make any change now so this bug happens. https://github.com/pingcap/dm/blob/d2dc22df29c11750b67b860d878fd9cd461b9d9f/dm/config/subtask.go#L388

Workaround

stop task and start same task again

lance6716 commented 3 years ago

i remember this has been fixed by @okJiang

lance6716 commented 3 years ago

maybe duplicate with https://github.com/pingcap/dm/issues/2034

lichunzhu commented 3 years ago

I see. This commit should be added in v2.0.8. I checked v2.0.7 and this is not picked. Close this issue now.