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

tools, media, readme: add DM shard merge #887

Merged
merged 5 commits into from
Feb 11, 2019

Conversation

lilin90
Copy link
Member

@lilin90 lilin90 commented Feb 3, 2019

This PR adds the DM shard merge file, updates the TOC, adds the images that are ignored in #886.

Note: Since the file in #876 (created by @yikeke) has links that point to the file added in this PR, #876 can only be merged after this PR is merged.

@GregoryIan @csuzhangxc @CaitinChen @yikeke PTAL

Related Issue: #874

Related PRs:

@yikeke
Copy link
Contributor

yikeke commented Feb 9, 2019

LGTM

- For each sharding group, it is recommended to use one independent task to perform the replication.
- In a sharding group, the corresponding DDL statements should be executed in all upstream sharded tables.
- For example, if DDL statements are not executed on one or more upstream sharded tables corresponding to `DM-worker-2`, then other DM-workers that have executed the DDL statements will pause their synchronization task and wait for `DM-worker-2` to receive the upstream DDL statements.
- In a sharding group, the next DDL statement cannot be executed unless the current DDL operation is completely finished.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge it with In a logical **sharding group** (composed of all sharded tables that need to be merged and replicated into one same downstream table), the same DDL statements must be executed in the same order in all upstream sharded tables (the schema name and the table name can be different) at L17?

- During the replication of sharding DDL statements, an error is reported if you use `dmctl` to change `router-rules`.
- If you need to `CREATE` a new table to a sharding group where DDL statements are being executed, you have to make sure that the table schema is the same as the newly modified table schema.
- For example, the original `table_1` and `table_2` has two columns (a, b) initially, and has three columns (a, b, c) after the sharding DDL operation, so after the replication the newly created table should also have three columns (a, b, c).
- Because the DM-worker that has received the DDL statements will pause the task to wait for other DM-workers to receive their DDL statements, the data replication will be increased.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's meaning of the data replication will be increased.?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the delay of data replication?

- A single `RENAME TABLE` statement can only involve a single `RENAME` operation. (Online DDL is supported in another solution)
- The table schema of each sharded table must be the same at the starting point of the incremental replication task, so as to make sure the DML statements of different sharded tables can be replicated into the downstream with a definite table schema, and the subsequent sharding DDL statements can be correctly matched and replicated.
- If you need to change the [table routing](../../tools/dm/data-synchronization-features.md#table-routing) rule, you have to wait for the replication of all sharding DDL statements to complete.
- During the replication of sharding DDL statements, an error is reported if you use `dmctl` to change `router-rules`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a test case for it? @amyangfei @csuzhangxc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think no test case exists, and we only add a check in DM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should make sure it works

- In a sharding group, the next DDL statement cannot be executed unless the current DDL operation is completely finished.
- The sharding group replication task does not support `DROP DATABASE/DROP TABLE`.
- The Syncer unit in DM-worker automatically ignores the `DROP DATABASE/DROP TABLE` statement of upstream sharded tables.
- The sharding group replication task supports `RENAME TABLE`, but with the following limitations:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add (Online DDL is supported in another solution) here

@IANTHEREAL
Copy link
Contributor

Rest LGTM

- [Troubleshoot](/tools/dm/troubleshooting-sharding-ddl-locks.md)
- [Introduction](tools/dm/shard-merge.md)
- [Restrictions](tools/dm/shard-merge.md#restrictions)
- [Handle Sharding DDL Locks manually](tools/dm/manually-handling-sharding-ddl-locks.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link to file added in #876. so we need to merge #876 as soon as this PR merged?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

tools/dm/shard-merge.md Outdated Show resolved Hide resolved
@lilin90
Copy link
Member Author

lilin90 commented Feb 11, 2019

@GregoryIan @csuzhangxc Thanks! PTAL again

tools/dm/shard-merge.md Outdated Show resolved Hide resolved
Co-Authored-By: lilin90 <lilin@pingcap.com>
@csuzhangxc
Copy link
Member

LGTM

Copy link
Contributor

@IANTHEREAL IANTHEREAL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lilin90 lilin90 merged commit c80e5d0 into pingcap:master Feb 11, 2019
@lilin90 lilin90 deleted the add-dm-shard-merge branch February 11, 2019 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants