diff --git a/en/TOC.md b/en/TOC.md index 7bed6c3e6..f23cfe68e 100644 --- a/en/TOC.md +++ b/en/TOC.md @@ -44,7 +44,7 @@ - [Pause a Task](pause-task.md) - [Resume a Task](resume-task.md) - [Stop a Task](stop-task.md) - - [Handle Failed SQL Statements](handle-failed-sql-statements.md) + - [Handle Failed DDL Statements](handle-failed-ddl-statements.md) - [Manually Handle Sharding DDL Locks](manually-handling-sharding-ddl-locks.md) - [Manage Table Schema during Migration](manage-schema.md) - [Handle Alerts](handle-alerts.md) diff --git a/en/_index.md b/en/_index.md index b2461fea6..5202b8e96 100644 --- a/en/_index.md +++ b/en/_index.md @@ -12,7 +12,7 @@ aliases: ['/docs/tidb-data-migration/dev/'] - [High availability of data migration tasks](overview.md#high-availability). The data migration task can run normally even when some DM-master or DM-worker nodes fail. - [Sharding DDL support in the optimistic mode](feature-shard-merge-optimistic.md). In this mode, migration latency can be reduced in some scenarios and you can make A/B changes in the upstream database. -- Better usability, including the new [error handling mechanism](handle-failed-sql-statements.md) and the easier-to-read error messages and error handling suggestions. +- Better usability, including the new [error handling mechanism](handle-failed-ddl-statements.md) and the easier-to-read error messages and error handling suggestions. - [TLS support](enable-tls.md) for connections between the upstream and the downstream, and for connections between DM components. - Support for migrating data from MySQL 8.0 (experimental). diff --git a/en/faq.md b/en/faq.md index 469c08bce..0a479c954 100644 --- a/en/faq.md +++ b/en/faq.md @@ -24,7 +24,7 @@ DM will attempt to split a single statement containing multiple DDL change opera ## How to handle incompatible DDL statements? -When you encounter a DDL statement unsupported by TiDB, you need to manually handle it using dmctl (skipping the DDL statement or replacing the DDL statement with a specified DDL statement). For details, see [Handle failed SQL statements](handle-failed-sql-statements.md). +When you encounter a DDL statement unsupported by TiDB, you need to manually handle it using dmctl (skipping the DDL statement or replacing the DDL statement with a specified DDL statement). For details, see [Handle failed DDL statements](handle-failed-ddl-statements.md). > **Note:** > diff --git a/en/handle-failed-sql-statements.md b/en/handle-failed-ddl-statements.md similarity index 97% rename from en/handle-failed-sql-statements.md rename to en/handle-failed-ddl-statements.md index 6a3729215..7eecbba54 100644 --- a/en/handle-failed-sql-statements.md +++ b/en/handle-failed-ddl-statements.md @@ -1,14 +1,14 @@ --- -title: Handle Failed SQL Statements -summary: Learn how to handle failed SQL statements when you're using the TiDB Data Migration tool to migrate data. -aliases: ['/docs/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements/','/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements'] +title: Handle Failed DDL Statements +summary: Learn how to handle failed DDL statements when you're using the TiDB Data Migration tool to migrate data. +aliases: ['/docs/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements/','/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements','/tidb-data-migration/dev/handle-failed-sql-statements'] --- -# Handle Failed SQL Statements +# Handle Failed DDL Statements -This document introduces how to handle failed SQL statements when you're using the TiDB Data Migration (DM) tool to migrate data. +This document introduces how to handle failed DDL statements when you're using the TiDB Data Migration (DM) tool to migrate data. -Currently, TiDB is not completely compatible with all MySQL syntax (see [the DDL statements supported by TiDB](https://pingcap.com/docs/dev/reference/mysql-compatibility/#ddl)). Therefore, when DM is migrating data from MySQL to TiDB and TiDB does not support the corresponding SQL statement, an error might occur and break the migration process. In this case, you can use the `handle-error` command of DM to resume the migration. +Currently, TiDB is not completely compatible with all MySQL syntax (see [the DDL statements supported by TiDB](https://pingcap.com/docs/dev/reference/mysql-compatibility/#ddl)). Therefore, when DM is migrating data from MySQL to TiDB and TiDB does not support the corresponding DDL statement, an error might occur and break the migration process. In this case, you can use the `handle-error` command of DM to resume the migration. ## Restrictions @@ -25,7 +25,7 @@ During the migration, the DDL statement unsupported by TiDB is executed in the u ## Command -When you use dmctl to manually handle the failed SQL statements, the commonly used commands include `query-status` and `handle-error`. +When you use dmctl to manually handle the failed DDL statements, the commonly used commands include `query-status` and `handle-error`. ### query-status @@ -33,7 +33,7 @@ The `query-status` command is used to query the current status of items such as ### handle-error -The `handle-error` command is used to handle the failed SQL statements. +The `handle-error` command is used to handle the failed DDL statements. ### Command usage @@ -65,19 +65,19 @@ Global Flags: + `skip`: Skip the error -+ `replace`: Replace the failed SQL statement ++ `replace`: Replace the failed DDL statement + `revert`: Reset the previous skip/replace operation before the error occurs (only reset it when the previous skip/replace operation has not finally taken effect) + `binlog-pos`: - Flag parameter, string, `--binlog-pos` - - If it is not specified, DM automatically handles the currently failed SQL statement. + - If it is not specified, DM automatically handles the currently failed DDL statement. - If it is specified, the skip operation is executed when `binlog-pos` matches with the position of the binlog event. The format is `binlog-filename:binlog-pos`, for example, `mysql-bin|000001.000003:3270`. - After the migration returns an error, the binlog position can be obtained from `position` in `startLocation` returned by `query-status`. Before the migration returns an error, the binlog position can be obtained by using [`SHOW BINLOG EVENTS`](https://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html) in the upstream MySQL instance. ## Usage examples -### Skip SQL if the migration gets interrupted +### Skip DDL if the migration gets interrupted #### Non-shard-merge scenario @@ -414,7 +414,7 @@ Assume that it is acceptable in the actual production environment that this DDL You can see that the task runs normally with no error and all four wrong DDL statements are skipped. -### Replace SQL if the migration gets interrupted +### Replace DDL if the migration gets interrupted #### Non-shard-merge scenario diff --git a/en/overview.md b/en/overview.md index 39b7b6887..e476f36ee 100644 --- a/en/overview.md +++ b/en/overview.md @@ -14,7 +14,7 @@ aliases: ['/docs/tidb-data-migration/dev/overview/'] - [High availability of data migration task](#high-availability). The data migration task can run normally even when some DM-master or DM-worker nodes fail. - [Sharding DDL support in the optimistic mode](feature-shard-merge-optimistic.md). In this mode, migration latency can be reduced in some scenarios and you can make A/B changes in the upstream database. -- Better usability, including the new [error handling mechanism](handle-failed-sql-statements.md) and the easier-to-read error messages and error handling suggestions. +- Better usability, including the new [error handling mechanism](handle-failed-ddl-statements.md) and the easier-to-read error messages and error handling suggestions. - [TLS support](enable-tls.md) for connections between the upstream and the downstream, and for connections between DM components. - Support for migrating data from MySQL 8.0 (experimental). diff --git a/zh/TOC.md b/zh/TOC.md index 9266336f7..8adb880c2 100644 --- a/zh/TOC.md +++ b/zh/TOC.md @@ -43,7 +43,7 @@ - [暂停任务](pause-task.md) - [恢复任务](resume-task.md) - [停止任务](stop-task.md) - - [处理出错的 SQL 语句](handle-failed-sql-statements.md) + - [处理出错的 DDL 语句](handle-failed-ddl-statements.md) - [手动处理 Sharding DDL Lock](manually-handling-sharding-ddl-locks.md) - [管理迁移中表的表结构](manage-schema.md) - [告警处理](handle-alerts.md) diff --git a/zh/_index.md b/zh/_index.md index 6b153fb61..df62631ac 100644 --- a/zh/_index.md +++ b/zh/_index.md @@ -12,7 +12,7 @@ DM 2.0 相比于 1.0,主要有以下改进: - [数据迁移任务的高可用](overview.md#高可用),部分 DM-master、DM-worker 节点异常后仍能保证数据迁移任务的正常运行。 - [乐观协调模式下的 sharding DDL](feature-shard-merge-optimistic.md) 可以在部分场景下减少 sharding DDL 同步过程中的延迟、支持上游数据库灰度变更等场景。 -- 更好的易用性,包括新的[错误处理机制](handle-failed-sql-statements.md)及更清晰易读的错误信息与错误处理建议。 +- 更好的易用性,包括新的[错误处理机制](handle-failed-ddl-statements.md)及更清晰易读的错误信息与错误处理建议。 - 与上下游数据库及 DM 各组件间连接的 [TLS 支持](enable-tls.md)。 - 实验性地支持从 MySQL 8.0 迁移数据。 diff --git a/zh/faq.md b/zh/faq.md index e4238ea9f..082caf2c0 100644 --- a/zh/faq.md +++ b/zh/faq.md @@ -26,7 +26,7 @@ DM 会尝试将包含多个 DDL 变更操作的单条语句拆分成只包含一 ## 如何处理不兼容的 DDL 语句? -你需要使用 dmctl 手动处理 TiDB 不兼容的 DDL 语句(包括手动跳过该 DDL 语句或使用用户指定的 DDL 语句替换原 DDL 语句,详见[处理出错的 SQL 语句](handle-failed-sql-statements.md))。 +你需要使用 dmctl 手动处理 TiDB 不兼容的 DDL 语句(包括手动跳过该 DDL 语句或使用用户指定的 DDL 语句替换原 DDL 语句,详见[处理出错的 DDL 语句](handle-failed-ddl-statements.md))。 > **注意:** > diff --git a/zh/handle-failed-sql-statements.md b/zh/handle-failed-ddl-statements.md similarity index 98% rename from zh/handle-failed-sql-statements.md rename to zh/handle-failed-ddl-statements.md index 56f4f8d4f..f7597a643 100644 --- a/zh/handle-failed-sql-statements.md +++ b/zh/handle-failed-ddl-statements.md @@ -1,14 +1,14 @@ --- -title: 处理出错的 SQL 语句 -summary: 了解在使用 TiDB Data Migration 迁移数据时,如何处理出错的 SQL 语句。 -aliases: ['/docs-cn/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements/','/zh/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements'] +title: 处理出错的 DDL 语句 +summary: 了解在使用 TiDB Data Migration 迁移数据时,如何处理出错的 DDL 语句。 +aliases: ['/docs-cn/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements/','/zh/tidb-data-migration/dev/skip-or-replace-abnormal-sql-statements','/zh/tidb-data-migration/dev/handle-failed-sql-statements'] --- -# 处理出错的 SQL 语句 +# 处理出错的 DDL 语句 -本文介绍了如何使用 DM 来处理出错的 SQL 语句。 +本文介绍了如何使用 DM 来处理出错的 DDL 语句。 -目前,TiDB 并不完全兼容所有的 MySQL 语法(详见 [TiDB 已支持的 DDL 语句](https://pingcap.com/docs-cn/dev/reference/mysql-compatibility/#ddl))。当使用 DM 从 MySQL 迁移数据到 TiDB 时,如果 TiDB 不支持对应的 SQL 语句,可能会造成错误并中断迁移任务。在这种情况下,DM 提供 `handle-error` 命令来恢复迁移。 +目前,TiDB 并不完全兼容所有的 MySQL 语法(详见 [TiDB 已支持的 DDL 语句](https://pingcap.com/docs-cn/dev/reference/mysql-compatibility/#ddl))。当使用 DM 从 MySQL 迁移数据到 TiDB 时,如果 TiDB 不支持对应的 DDL 语句,可能会造成错误并中断迁移任务。在这种情况下,DM 提供 `handle-error` 命令来恢复迁移。 ## 使用限制 @@ -25,7 +25,7 @@ aliases: ['/docs-cn/tidb-data-migration/dev/skip-or-replace-abnormal-sql-stateme ## 命令介绍 -使用 dmctl 手动处理出错的 SQL 语句时,主要使用的命令包括 `query-status`、`handle-error`。 +使用 dmctl 手动处理出错的 DDL 语句时,主要使用的命令包括 `query-status`、`handle-error`。 ### query-status @@ -33,7 +33,7 @@ aliases: ['/docs-cn/tidb-data-migration/dev/skip-or-replace-abnormal-sql-stateme ### handle-error -`handle-error` 命令用于处理错误的 sql 语句。 +`handle-error` 命令用于处理错误的 DDL 语句。 ### 命令用法 @@ -71,7 +71,7 @@ Global Flags: + `binlog-pos`: - flag 参数,string,`--binlog-pos`; - - 若不指定,DM 会自动处理当前出错的 SQL 语句 + - 若不指定,DM 会自动处理当前出错的 DDL 语句 - 在指定时表示操作将在 `binlog-pos` 与 binlog event 的 position 匹配时生效,格式为 `binlog-filename:binlog-pos`,如 `mysql-bin|000001.000003:3270`。 - 在迁移执行出错后,binlog position 可直接从 `query-status` 返回的 `startLocation` 中的 `position` 获得;在迁移执行出错前,binlog position 可在上游 MySQL 中使用 [`SHOW BINLOG EVENTS`](https://dev.mysql.com/doc/refman/5.7/en/show-binlog-events.html) 获得。 diff --git a/zh/overview.md b/zh/overview.md index 02001ab3a..90c55fa9e 100644 --- a/zh/overview.md +++ b/zh/overview.md @@ -11,7 +11,7 @@ DM 2.0 相比于 1.0,主要有以下改进: - [数据迁移任务的高可用](#高可用),部分 DM-master、DM-worker 节点异常后仍能保证数据迁移任务的正常运行。 - [乐观协调模式下的 sharding DDL](feature-shard-merge-optimistic.md) 可以在部分场景下减少 sharding DDL 同步过程中的延迟、支持上游数据库灰度变更等场景。 -- 更好的易用性,包括新的[错误处理机制](handle-failed-sql-statements.md)及更清晰易读的错误信息与错误处理建议。 +- 更好的易用性,包括新的[错误处理机制](handle-failed-ddl-statements.md)及更清晰易读的错误信息与错误处理建议。 - 与上下游数据库及 DM 各组件间连接的 [TLS 支持](enable-tls.md)。 - 实验性地支持从 MySQL 8.0 迁移数据。