-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Refactor data migration #7480
Refactor data migration #7480
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@sunzhaoyang 在英文 docs 仓库是合入的 refactor-data-migration 分支,在中文 docs-cn 仓库要合入 master 分支吗?另外,请签署 Contributor License Agreement ,谢谢~ |
是的,英文的 refactor-data-migration 分支用于前期效果预览,现在已经不需要了。此 PR 就是预期的内容希望合进 master |
|
||
## 迁移 Aurora MySQL 到 TiDB | ||
|
||
从 Aurora 迁移数据到部署在 AWS 的 TiDB 集群, 数据迁移可以氛围全量迁移和增量迁移两个步骤进行,根据你的业务需求选择相应的步骤。考虑到 Aurora 和 TiDB 部署在不同 region 的情况,方案也包含介绍从不同 region 之前进行数据迁移的最佳实践。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从 Aurora 迁移数据到部署在 AWS 的 TiDB 集群, 数据迁移可以氛围全量迁移和增量迁移两个步骤进行,根据你的业务需求选择相应的步骤。考虑到 Aurora 和 TiDB 部署在不同 region 的情况,方案也包含介绍从不同 region 之前进行数据迁移的最佳实践。 | |
从 Aurora 迁移数据到部署在 AWS 的 TiDB 集群, 数据迁移可以分为全量迁移和增量迁移两个步骤,根据你的业务需求选择相应的步骤。对于 Aurora 和 TiDB 部署在不同 region 的情况,方案也包含不同 region 之间进行数据迁移的最佳实践。 |
“从 Aurora 迁移数据到 TiDB”里貌似没提到 region。是说 S3 跨 region 便宜吗(快帮我复习 SAA 考试)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还没写跨 region 的....
Co-authored-by: lance6716 <lance6716@gmail.com>
Co-authored-by: lance6716 <lance6716@gmail.com>
…-cn into refactor-data-migration
|
||
在进行增量数据迁移时,可以通过[如何过滤 binlog 事件](/data-migration/migrate-with-binlog-event-filter.md)功能过滤某些类型的 binlog event,例如不向下游迁移 `DELETE` 事件以达到归档、审计等目的。但是 binlog event filter 无法以更细粒度判断某一行的 `DELETE` 事件是否要被过滤。 | ||
|
||
为了解决上述问题,从 v2.0.5 起,DM 支持在增量数据同步阶段使用`binlog value filter`过滤迁移数据。DM 支持的 `ROW` 格式的 binlog 中,binlog event 带有所有列的值。你可以基于这些值配置 SQL 表达式。如果该表达式对于某条行变更的计算结果是 `TRUE`,DM 就不会向下游迁移该条行变更。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了解决上述问题,从 v2.0.5 起,DM 支持在增量数据同步阶段使用`binlog value filter`过滤迁移数据。DM 支持的 `ROW` 格式的 binlog 中,binlog event 带有所有列的值。你可以基于这些值配置 SQL 表达式。如果该表达式对于某条行变更的计算结果是 `TRUE`,DM 就不会向下游迁移该条行变更。 | |
为了解决上述问题,从 v2.0.5 起,DM 支持在增量数据同步阶段使用 `binlog value filter` 过滤迁移数据。DM 支持的 `ROW` 格式的 binlog 中,binlog event 带有所有列的值。你可以基于这些值配置 SQL 表达式。如果该表达式对于某条行变更的计算结果是 `TRUE`,DM 就不会向下游迁移该条行变更。 |
|
||
为了解决上述问题,从 v2.0.5 起,DM 支持在增量数据同步阶段使用`binlog value filter`过滤迁移数据。DM 支持的 `ROW` 格式的 binlog 中,binlog event 带有所有列的值。你可以基于这些值配置 SQL 表达式。如果该表达式对于某条行变更的计算结果是 `TRUE`,DM 就不会向下游迁移该条行变更。 | ||
|
||
与[如何过滤 binlog 事件](/data-migration/migrate-with-binlog-event-filter.md)类似,表达式过滤需要在数据迁移任务配置文件里配置,详见下面配置样例。完整的配置及意义,可以参考 [DM 完整配置文件示例](https://docs.pingcap.com/zh/tidb-data-migration/stable/task-configuration-file-full#完整配置文件示例): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
与[如何过滤 binlog 事件](/data-migration/migrate-with-binlog-event-filter.md)类似,表达式过滤需要在数据迁移任务配置文件里配置,详见下面配置样例。完整的配置及意义,可以参考 [DM 完整配置文件示例](https://docs.pingcap.com/zh/tidb-data-migration/stable/task-configuration-file-full#完整配置文件示例): | |
与[如何过滤 binlog 事件](/data-migration/migrate-with-binlog-event-filter.md)类似,你需要在数据迁移任务配置文件里配置 `binlog value filter`,详见下面配置样例。完整的配置及意义,可以参考 [DM 完整配置文件示例](https://docs.pingcap.com/zh/tidb-data-migration/stable/task-configuration-file-full#完整配置文件示例): |
|
||
随后在下游查询 `tbl` 表,可见只有 `c` 的值为单数的行迁移到了下游: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
```sql |
Co-authored-by: Enwei <jinenwei@pingcap.com>
…-cn into refactor-data-migration
summary: 介绍如何通过 SQL 表达式过滤 DML 事件 | ||
--- | ||
|
||
# 如何通过 SQL 表达式过滤 DML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 如何通过 SQL 表达式过滤 DML | |
# 如何通过 SQL 表达式过滤 DML |
Signed-off-by: Ran <huangran@pingcap.com>
Signed-off-by: Ran <huangran@pingcap.com>
Signed-off-by: Ran <huangran@pingcap.com>
TOC.md
Outdated
- [从 SQL 文件迁移到 TiDB](/migrate-from-mysql-dumpling-files.md) | ||
- [将 TiDB 集群的增量数据同步到另一集群](/incremental-replication-between-clusters.md) | ||
- 数据迁移场景 | ||
- [从 Aurora 迁移数据到 TiDB](/data-migration/migrate-aurora-to-tidb.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是需要新增一个 data-migration 文件夹吗? 会不会和现有的 dm 文件夹容易混淆。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是新加了目录。dm 目录只是 dm 工具自己的文档。data-migration 是数据迁移场景的文档,不仅包含 dm,还有其他工具
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,看了下没有必要新增文件夹。现有的文件夹大多是对应某个组件的。
Signed-off-by: Ran <huangran@pingcap.com>
Signed-off-by: Ran <huangran@pingcap.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2536d7d
|
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?