Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zh: update "safe mode" (#444) #450

Merged
merged 2 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions zh/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ DM-worker 内部用于从上游拉取 Binlog 并写入数据到 Relay log 的处

### Safe mode

指增量复制过程中,用于支持在表结构中存在主键或唯一索引的条件下可重复导入 DML 的模式。
指增量复制过程中,用于支持在表结构中存在主键或唯一索引的条件下可重复导入 DML 的模式。该模式的主要特点是:将来自上游的 `INSERT` 改写为 `REPLACE`,将 `UPDATE` 改写为 `DELETE` 与 `REPLACE` 后再向下游执行。

该模式的主要特点为将来自上游的 `INSERT` 改写为 `REPLACE`,将 `UPDATE` 改写为 `DELETE` 与 `REPLACE` 后再向下游执行。在启动或恢复增量复制任务的前 5 分钟 TiDB DM 会自动启动 Safe mode,另外也可以在任务配置文件中通过 `safe-mode` 参数手动开启。
该模式会在满足如下任一条件时启用:

- 启动或恢复增量复制任务的前 5 分钟保持启用
- 任务配置文件中设置 `safe-mode: true` 时会始终启用
- 在全量迁移任务中的 dump 处理单元配置 `--consistency none` 后,不能确定导出开始时的 binlog 变动是否影响了导出数据。Safe mode 会在增量复制这部分 binlog 时保持启用

### Shard DDL

Expand Down
2 changes: 1 addition & 1 deletion zh/migrate-from-mysql-aurora.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ tiup dmctl --master-addr 127.0.0.1:8261 operate-source create dm-test/source2.ya

> **注意:**
>
> 由于 Aurora 不支持 FTWRL,仅使用全量模式导出数据时需要暂停写入,参见 [AWS 官网说明](https://aws.amazon.com/cn/premiumsupport/knowledge-center/mysqldump-error-rds-mysql-mariadb/)。在示例的全量+增量模式下,DM 将自动启用 `safe mode` 解决这一问题。在其他模式下如需保证数据一致,参见 [AWS 官网说明](https://aws.amazon.com/cn/premiumsupport/knowledge-center/mysqldump-error-rds-mysql-mariadb/)操作。
> 由于 Aurora 不支持 FTWRL,仅使用全量模式导出数据时需要暂停写入,参见 [AWS 官网说明](https://aws.amazon.com/cn/premiumsupport/knowledge-center/mysqldump-error-rds-mysql-mariadb/)。在示例的全量+增量模式下,DM 将自动启用 [`safe mode`](glossary.md#safe-mode) 解决这一问题。在其他模式下如需保证数据一致,参见 [AWS 官网说明](https://aws.amazon.com/cn/premiumsupport/knowledge-center/mysqldump-error-rds-mysql-mariadb/)操作。

本示例选择迁移 Aurora 已有数据并将新增数据实时迁移给 TiDB,即**全量+增量**模式。根据上文的 TiDB 集群信息、已添加的 `source-id`、要迁移的表,保存如下任务配置文件 `task.yaml`:

Expand Down