From e170a22ac346962079b4e77757987bf9e9a1b005 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Tue, 18 Jan 2022 14:11:53 +0800 Subject: [PATCH] Revert "dm/test: swap upstream and downstream of sync_diff in some cases (#3413)" This reverts commit 35102b501ac2595c4adb29582a0afc0e6e28b630. --- .../conf/diff_config_revert_1.toml | 31 ------------------- .../conf/diff_config_revert_2.toml | 31 ------------------- dm/tests/adjust_gtid/run.sh | 6 ++-- .../full_mode/conf/diff_config_revert_1.toml | 30 ------------------ .../full_mode/conf/diff_config_revert_2.toml | 30 ------------------ dm/tests/full_mode/run.sh | 10 ++---- .../conf/diff_config_revert_1.toml | 30 ------------------ .../conf/diff_config_revert_2.toml | 30 ------------------ dm/tests/incremental_mode/run.sh | 6 ++-- 9 files changed, 7 insertions(+), 197 deletions(-) delete mode 100644 dm/tests/adjust_gtid/conf/diff_config_revert_1.toml delete mode 100644 dm/tests/adjust_gtid/conf/diff_config_revert_2.toml delete mode 100644 dm/tests/full_mode/conf/diff_config_revert_1.toml delete mode 100644 dm/tests/full_mode/conf/diff_config_revert_2.toml delete mode 100644 dm/tests/incremental_mode/conf/diff_config_revert_1.toml delete mode 100644 dm/tests/incremental_mode/conf/diff_config_revert_2.toml diff --git a/dm/tests/adjust_gtid/conf/diff_config_revert_1.toml b/dm/tests/adjust_gtid/conf/diff_config_revert_1.toml deleted file mode 100644 index 455ed32451f..00000000000 --- a/dm/tests/adjust_gtid/conf/diff_config_revert_1.toml +++ /dev/null @@ -1,31 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql1" - - target-check-tables = ["adjust_gtid.t?*"] - - -[data-sources] -[data-sources.mysql1] -host = "127.0.0.1" -port = 3306 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/adjust_gtid/conf/diff_config_revert_2.toml b/dm/tests/adjust_gtid/conf/diff_config_revert_2.toml deleted file mode 100644 index 6d38ad7fb17..00000000000 --- a/dm/tests/adjust_gtid/conf/diff_config_revert_2.toml +++ /dev/null @@ -1,31 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql2" - - target-check-tables = ["adjust_gtid.t?*"] - - -[data-sources] -[data-sources.mysql2] -host = "127.0.0.1" -port = 3307 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/adjust_gtid/run.sh b/dm/tests/adjust_gtid/run.sh index 88e493b05c2..5d38094f635 100755 --- a/dm/tests/adjust_gtid/run.sh +++ b/dm/tests/adjust_gtid/run.sh @@ -89,8 +89,7 @@ function run() { "start-task $WORK_DIR/dm-task.yaml --remove-meta" # use sync_diff_inspector to check full dump loader - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml name1=$(grep "Log: " $WORK_DIR/worker1/dumped_data.$TASK_NAME/metadata | awk -F: '{print $2}' | tr -d ' ') pos1=$(grep "Pos: " $WORK_DIR/worker1/dumped_data.$TASK_NAME/metadata | awk -F: '{print $2}' | tr -d ' ') @@ -132,8 +131,7 @@ function run() { check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER2_PORT # use sync_diff_inspector to check incremental dump loader - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml run_sql_both_source "SET @@GLOBAL.SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'" run_sql_both_source "SET @@global.time_zone = 'SYSTEM';" diff --git a/dm/tests/full_mode/conf/diff_config_revert_1.toml b/dm/tests/full_mode/conf/diff_config_revert_1.toml deleted file mode 100644 index f690ce6e804..00000000000 --- a/dm/tests/full_mode/conf/diff_config_revert_1.toml +++ /dev/null @@ -1,30 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql1" - - target-check-tables = ["full_mode.t?*"] - - -[data-sources] -[data-sources.mysql1] -host = "127.0.0.1" -port = 3306 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/full_mode/conf/diff_config_revert_2.toml b/dm/tests/full_mode/conf/diff_config_revert_2.toml deleted file mode 100644 index 84a3ecd2d43..00000000000 --- a/dm/tests/full_mode/conf/diff_config_revert_2.toml +++ /dev/null @@ -1,30 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql2" - - target-check-tables = ["full_mode.t?*"] - - -[data-sources] -[data-sources.mysql2] -host = "127.0.0.1" -port = 3307 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/full_mode/run.sh b/dm/tests/full_mode/run.sh index c72e7e46813..afb89800720 100755 --- a/dm/tests/full_mode/run.sh +++ b/dm/tests/full_mode/run.sh @@ -60,7 +60,6 @@ function fail_acquire_global_lock() { "you need (at least one of) the RELOAD privilege(s) for this operation" 2 cleanup_data full_mode - cleanup_data_upstream full_mode cleanup_process $* } @@ -105,6 +104,7 @@ function escape_schema() { # start DM task only dmctl_start_task "$WORK_DIR/dm-task.yaml" "--remove-meta" + check_sync_diff $WORK_DIR $WORK_DIR/diff_config.toml check_log_contain_with_retry 'clean dump files' $WORK_DIR/worker1/log/dm-worker.log check_log_contain_with_retry 'clean dump files' $WORK_DIR/worker2/log/dm-worker.log @@ -118,7 +118,6 @@ function escape_schema() { check_metric $WORKER2_PORT 'dumpling_dump_finished_tables' 3 0 3 cleanup_data full/mode - cleanup_data_upstream full/mode cleanup_process $* } @@ -131,8 +130,7 @@ function empty_data() { init_cluster dmctl_start_task "$cur/conf/dm-task.yaml" "--remove-meta" - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "query-status test" \ @@ -144,7 +142,6 @@ function empty_data() { check_log_contains $WORK_DIR/worker2/log/dm-worker.log "progress=\"100.00 %\"" cleanup_data full_mode - cleanup_data_upstream full_mode cleanup_process $* } @@ -193,8 +190,7 @@ function run() { dmctl_start_task "$cur/conf/dm-task.yaml" "--remove-meta" # use sync_diff_inspector to check full dump loader - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml echo "check dump files have been cleaned" ls $WORK_DIR/worker1/dumped_data.test && exit 1 || echo "worker1 auto removed dump files" diff --git a/dm/tests/incremental_mode/conf/diff_config_revert_1.toml b/dm/tests/incremental_mode/conf/diff_config_revert_1.toml deleted file mode 100644 index 45328c12217..00000000000 --- a/dm/tests/incremental_mode/conf/diff_config_revert_1.toml +++ /dev/null @@ -1,30 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql1" - - target-check-tables = ["incremental_mode.t?*"] - - -[data-sources] -[data-sources.mysql1] -host = "127.0.0.1" -port = 3306 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/incremental_mode/conf/diff_config_revert_2.toml b/dm/tests/incremental_mode/conf/diff_config_revert_2.toml deleted file mode 100644 index 16ed402a93f..00000000000 --- a/dm/tests/incremental_mode/conf/diff_config_revert_2.toml +++ /dev/null @@ -1,30 +0,0 @@ -# diff Configuration. - -check-thread-count = 4 - -export-fix-sql = true - -check-struct-only = false - -[task] - output-dir = "/tmp/ticdc_dm_test/output" - - source-instances = ["tidb0"] - - target-instance = "mysql2" - - target-check-tables = ["incremental_mode.t?*"] - - -[data-sources] -[data-sources.mysql2] -host = "127.0.0.1" -port = 3307 -user = "root" -password = "123456" - -[data-sources.tidb0] -host = "127.0.0.1" -port = 4000 -user = "test" -password = "123456" diff --git a/dm/tests/incremental_mode/run.sh b/dm/tests/incremental_mode/run.sh index 34d5aab8b3b..e0493b1e751 100755 --- a/dm/tests/incremental_mode/run.sh +++ b/dm/tests/incremental_mode/run.sh @@ -76,8 +76,7 @@ function run() { sed -i "s/binlog-pos-placeholder-2/4/g" $WORK_DIR/dm-task.yaml dmctl_start_task $WORK_DIR/dm-task.yaml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml dmctl_stop_task $TASK_NAME @@ -266,8 +265,7 @@ function run() { "resume-task test" \ "\"result\": true" 3 - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_1.toml - check_sync_diff $WORK_DIR $cur/conf/diff_config_revert_2.toml + check_sync_diff $WORK_DIR $cur/conf/diff_config.toml # test rotate binlog, after rotate and ddl, master binlog should be equal to sync binlog run_sql "flush logs;" $MYSQL_PORT1 $MYSQL_PASSWORD1