Skip to content

Commit

Permalink
tools/dm: add description for task auto restore after dm-worker restart
Browse files Browse the repository at this point in the history
  • Loading branch information
yikeke committed Apr 3, 2019
1 parent d1fd9bb commit 4a03840
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/dm/cluster-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ This sections describes the considerations that you need to know when you restar

**In the process of full data loading:**

For the SQL files during full data import, DM uses the downstream database to record the checkpoint information. When DM-worker is restarted, it checks the checkpoint information and you can use the [`start-task` command](/tools/dm/practice.md#step-4-start-the-data-synchronization-task) to recover the data synchronization task automatically.
For the SQL files during full data import, DM uses the downstream database to record the checkpoint information, and DM-worker records the subtask information in the local meta file. When DM-worker is restarted, it checks the checkpoint information and the subtask information in the local record, and the running task before restarting recovers the data synchronization automatically.

**In the process of incremental data synchronization:**

For the binlog during incremental data import, DM uses the downstream database to record the checkpoint information, and enables the safe mode within the first 5 minutes after the synchronization task is started or recovered.

+ Sharding DDL statements synchronization is not enabled

If the sharding DDL statements synchronization is not enabled in the task running on DM-worker, when DM-worker is restarted, it checks the checkpoint information and you can use the `start-task` command to recover the data synchronization task automatically.
If the sharding DDL statements synchronization is not enabled in the task running on DM-worker, when DM-worker is restarted, it checks the checkpoint information and the subtask information in the local record, and the running task before restarting recovers the data synchronization automatically.

+ Sharding DDL statements synchronization is enabled

- When DM is synchronizing the sharding DDL statements, if DM-worker successfully executes (or skips) the sharding DDL binlog event, then the checkpoints of all tables related to sharding DDL in the DM-worker are updated to the position after the binlog event corresponding to the DDL statement.

- When DM-worker is restarted before or after synchronizing sharding DDL statements, it checks the checkpoint information and you can use the `start-task` command to recover the data synchronization task automatically.
- When DM-worker is restarted before or after synchronizing sharding DDL statements, it recovers the data synchronization automatically according to the checkpoint information and the subtask information in the local record.

- When DM-worker is restarted during the process of synchronizing sharding DDL statements, the issue might occur that the owner (one of DM-worker instances) has executed the DDL statement and successfully changed the downstream database table schema, while other DM-worker instances are restarted but fail to skip the DDL statement and update the checkpoints.

Expand Down

0 comments on commit 4a03840

Please sign in to comment.