Skip to content
This repository was archived by the owner on Jan 3, 2025. It is now read-only.

Fix broken link in shard-merge-best-practices.md and addd a missing section (#900) #901

Merged
merged 4 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions en/shard-merge-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ Then you can perform the following steps to fix the `ERROR 1062 (23000): Duplica

3. Run `query-status` to verify whether the data migration task is successfully processed and whether the data from upstream has already been merged and migrated to the downstream database.

## Special processing when the upstream RDS contains sharded tables

If the upstream data source is an RDS and it contains sharded tables, the table names in MySQL binlog might be invisible when connecting to a SQL client. For example, if the upstream is a UCloud distributed database, the table name in the binlog might have an extra prefix `_0001`. Therefore, you need to configure [table routing](dm-key-features.md#table-routing) based on the table names in binlog, instead of those in the SQL client.

## Create/drop tables in the upstream

In [Merge and Migrate Data from Sharded Tables](feature-shard-merge-pessimistic.md#principles), it is clear that the coordination of sharding DDL lock depends on whether the downstream database receives the DDL statements of all upstream sharded tables. In addition, DM currently **does not support** dynamically creating or dropping sharded tables in the upstream. Therefore, to create or drop sharded tables in the upstream, it is recommended to perform the following steps.
Expand Down
6 changes: 3 additions & 3 deletions zh/shard-merge-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ CREATE TABLE `tbl_no_pk` (
```

2. 在 `task.yaml` 文件中增加如下配置跳过自增主键冲突检查:

```yaml
ignore-checking-items: ["auto_increment_ID"]
```

3. 启动数据迁移任务,执行全量与增量数据迁移。

4. 通过 `query-status` 验证数据迁移任务是否正常,在下游数据库中验证合表中是否已经存在了来自上游的数据。
Expand Down Expand Up @@ -116,7 +116,7 @@ CREATE TABLE `tbl_multi_pk` (

## 上游 RDS 封装分库分表的处理

上游数据源为 RDS 且使用了其分库分表功能的情况下,MySQL binlog 中的表名在 SQL client 连接时可能并不可见。例如在 UCloud 分布式数据库 [UDDB](https://www.ucloud.cn/site/product/uddb.html) 中,其 binlog 表名可能会多出 `_0001` 的后缀。这需要根据 binlog 中的表名规律,而不是 SQL client 所见的表名,来配置 [table routing 规则](key-features.md#table-routing)。
上游数据源为 RDS 且使用了其分库分表功能的情况下,MySQL binlog 中的表名在 SQL client 连接时可能并不可见。例如在 UCloud 分布式数据库 [UDDB](https://docs.ucloud.cn/uddb/README) 中,其 binlog 表名可能会多出 `_0001` 的后缀。这需要根据 binlog 中的表名规律,而不是 SQL client 所见的表名,来配置 [table routing 规则](dm-key-features.md#table-routing)。

## 合表迁移过程中在上游增/删表

Expand Down