From 4f28a099259bb44e09e700885892d5d3a17f88d1 Mon Sep 17 00:00:00 2001 From: shichun-0415 Date: Fri, 21 Jan 2022 16:33:08 +0800 Subject: [PATCH 1/2] dm: add dm task timezone config --- dm/dm-task-configuration-guide.md | 1 + dm/task-configuration-file-full.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dm/dm-task-configuration-guide.md b/dm/dm-task-configuration-guide.md index e26749ef94fc..a40ca6922a0c 100644 --- a/dm/dm-task-configuration-guide.md +++ b/dm/dm-task-configuration-guide.md @@ -195,6 +195,7 @@ The following is an overall task configuration example of this document. The com name: test # The name of the task. Should be globally unique. shard-mode: "pessimistic" # The shard merge mode. Optional modes are ""/"pessimistic"/"optimistic". The "" mode is used by default which means sharding DDL merge is disabled. If the task is a shard merge task, set it to the "pessimistic" mode. After getting a deep understanding of the principles and restrictions of the "optimistic" mode, you can set it to the "optimistic" mode. task-mode: all # The task mode. Can be set to `full`(only migrates full data)/`incremental`(replicates binlog synchronously)/`all` (replicates both full and incremental binlogs). +timezone: "UTC" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. Customized timezone does not affect data migration but is unnecessary. ## ******** Data source configuration ********** mysql-instances: diff --git a/dm/task-configuration-file-full.md b/dm/task-configuration-file-full.md index 36c34bcac40c..e58e204d807e 100644 --- a/dm/task-configuration-file-full.md +++ b/dm/task-configuration-file-full.md @@ -25,10 +25,10 @@ The following is the task configuration file template which allows you to perfor name: test # The name of the task. Should be globally unique. task-mode: all # The task mode. Can be set to `full`(only migrates full data)/`incremental`(replicates binlogs synchronously)/`all` (replicates both full data and incremental binlogs). is-sharding: true # `is-sharding` has been deprecated since v2.0.0, so it is recommended to directly use `shard-mode` -shard-mode: "pessimistic" # The shard merge mode. Optional modes are ""/"pessimistic"/"optimistic". The "" mode is used by default which means sharding DDL merge is disabled. If the task is a shard merge task, set it to the "pessimistic" mode. +shard-mode: "pessimistic" # The shard merge mode. Optional modes are ""/"pessimistic"/"optimistic". The "" mode is used by default which means sharding DDL merge is disabled. If the task is a shard merge task, set it to the "pessimistic" mode. # After understanding the principles and restrictions of the "optimistic" mode, you can set it to the "optimistic" mode. meta-schema: "dm_meta" # The downstream database that stores the `meta` information. -timezone: "Asia/Shanghai" # The timezone. +timezone: "Asia/Shanghai" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. Customized timezone does not affect data migration but is unnecessary. case-sensitive: false # Determines whether the schema/table is case-sensitive. online-ddl: true # Supports automatic processing of upstream "gh-ost" and "pt". online-ddl-scheme: "gh-ost" # `online-ddl-scheme` has been deprecated in v2.0.6, so it is recommended to use `online-ddl`. From bc1f87c509c3946a7d124ae01405882cec13410d Mon Sep 17 00:00:00 2001 From: shichun-0415 <89768198+shichun-0415@users.noreply.github.com> Date: Fri, 21 Jan 2022 16:52:05 +0800 Subject: [PATCH 2/2] Apply suggestions from code review --- dm/dm-task-configuration-guide.md | 2 +- dm/task-configuration-file-full.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/dm-task-configuration-guide.md b/dm/dm-task-configuration-guide.md index a40ca6922a0c..34a5dcce1251 100644 --- a/dm/dm-task-configuration-guide.md +++ b/dm/dm-task-configuration-guide.md @@ -195,7 +195,7 @@ The following is an overall task configuration example of this document. The com name: test # The name of the task. Should be globally unique. shard-mode: "pessimistic" # The shard merge mode. Optional modes are ""/"pessimistic"/"optimistic". The "" mode is used by default which means sharding DDL merge is disabled. If the task is a shard merge task, set it to the "pessimistic" mode. After getting a deep understanding of the principles and restrictions of the "optimistic" mode, you can set it to the "optimistic" mode. task-mode: all # The task mode. Can be set to `full`(only migrates full data)/`incremental`(replicates binlog synchronously)/`all` (replicates both full and incremental binlogs). -timezone: "UTC" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. Customized timezone does not affect data migration but is unnecessary. +timezone: "UTC" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. A customized timezone does not affect data migration but is unnecessary. ## ******** Data source configuration ********** mysql-instances: diff --git a/dm/task-configuration-file-full.md b/dm/task-configuration-file-full.md index e58e204d807e..17741d209230 100644 --- a/dm/task-configuration-file-full.md +++ b/dm/task-configuration-file-full.md @@ -28,7 +28,7 @@ is-sharding: true # `is-sharding` has been deprecated since v2.0.0 shard-mode: "pessimistic" # The shard merge mode. Optional modes are ""/"pessimistic"/"optimistic". The "" mode is used by default which means sharding DDL merge is disabled. If the task is a shard merge task, set it to the "pessimistic" mode. # After understanding the principles and restrictions of the "optimistic" mode, you can set it to the "optimistic" mode. meta-schema: "dm_meta" # The downstream database that stores the `meta` information. -timezone: "Asia/Shanghai" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. Customized timezone does not affect data migration but is unnecessary. +timezone: "Asia/Shanghai" # The timezone used in SQL Session. By default, DM uses the global timezone setting in the target cluster, which ensures the correctness automatically. A customized timezone does not affect data migration but is unnecessary. case-sensitive: false # Determines whether the schema/table is case-sensitive. online-ddl: true # Supports automatic processing of upstream "gh-ost" and "pt". online-ddl-scheme: "gh-ost" # `online-ddl-scheme` has been deprecated in v2.0.6, so it is recommended to use `online-ddl`.