Skip to content

Commit

Permalink
Merge branch 'release-4.0' into cherry-pick-3667-to-release-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Dec 20, 2021
2 parents 2c9a23b + e1a3eb1 commit 472f94a
Show file tree
Hide file tree
Showing 50 changed files with 139 additions and 57 deletions.
7 changes: 2 additions & 5 deletions pkg/util/tz.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
package util

import (
"os"
"path/filepath"
"strings"
"time"

"github.com/pingcap/tidb/util/timeutil"
cerror "github.com/pingcap/tiflow/pkg/errors"
)

Expand Down Expand Up @@ -57,9 +57,6 @@ func GetLocalTimezone() (*time.Location, error) {
if time.Local.String() != "Local" {
return time.Local, nil
}
str, err := os.Readlink("/etc/localtime")
if err != nil {
return nil, cerror.WrapError(cerror.ErrLoadTimezone, err)
}
str := timeutil.InferSystemTZ()
return getTimezoneFromZonefile(str)
}
5 changes: 2 additions & 3 deletions tests/integration_tests/_utils/check_sync_diff
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ binary=sync_diff_inspector

PWD=$(pwd)
LOG=$workdir/sync_diff_inspector.log
OUTPUT_DIR=/tmp/ticdc_dm_test/output/

mkdir -p /tmp/ticdc_dm_test

cd $workdir
i=0
while [ $i -lt $check_time ]; do
rm -rf $OUTPUT_DIR
rm -rf $workdir/sync_diff/
$binary --config=$conf >>$LOG 2>&1
ret=$?
if [ "$ret" == 0 ]; then
Expand All @@ -38,7 +37,7 @@ if [ $i -ge $check_time ]; then
# show \n and other blanks
cat $LOG
printf "\n"
cat $OUTPUT_DIR/sync_diff.log
cat $workdir/sync_diff/output/sync_diff.log
printf "\n"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/autorandom/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/autorandom/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/batch_add_table/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/capture_session_done_during_task/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/capture_suicide_while_balance_table/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/changefeed_auto_stop/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/changefeed_error/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/changefeed_finish/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/changefeed_pause_resume/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/changefeed_reconstruct/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
29 changes: 29 additions & 0 deletions tests/integration_tests/clustered_index/conf/diff_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# diff Configuration.

check-thread-count = 4

export-fix-sql = true

check-struct-only = false

[task]
output-dir = "/tmp/tidb_cdc_test/clustered_index/sync_diff/output"

source-instances = ["mysql1"]

target-instance = "tidb0"

target-check-tables = ["clustered_index_test.?*"]

[data-sources]
[data-sources.mysql1]
host = "127.0.0.1"
port = 4000
user = "root"
password = ""

[data-sources.tidb0]
host = "127.0.0.1"
port = 3306
user = "root"
password = ""
2 changes: 1 addition & 1 deletion tests/integration_tests/common_1/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/common_1/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# diff Configuration.

check-thread-count = 4

export-fix-sql = true

check-struct-only = false

[task]
output-dir = "/tmp/tidb_cdc_test/consistent_replicate_nfs/sync_diff/output"

source-instances = ["mysql1"]

target-instance = "tidb0"

target-check-tables = ["consistent_replicate_nfs.usertable*"]

[data-sources]
[data-sources.mysql1]
host = "127.0.0.1"
port = 4000
user = "root"
password = ""

[data-sources.tidb0]
host = "127.0.0.1"
port = 3306
user = "root"
password = ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# diff Configuration.

check-thread-count = 4

export-fix-sql = true

check-struct-only = false

[task]
output-dir = "/tmp/tidb_cdc_test/consistent_replicate_s3/sync_diff/output"

source-instances = ["mysql1"]

target-instance = "tidb0"

target-check-tables = ["consistent_replicate_s3.usertable*"]

[data-sources]
[data-sources.mysql1]
host = "127.0.0.1"
port = 4000
user = "root"
password = ""

[data-sources.tidb0]
host = "127.0.0.1"
port = 3306
user = "root"
password = ""
2 changes: 1 addition & 1 deletion tests/integration_tests/cyclic_ab/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/cyclic_ab/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/cyclic_abc/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/cyclic_abc/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/ddl_async/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/ddl_attributes/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/ddl_reentrant/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/ddl_sequence/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/ddl_sequence/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/drop_many_tables/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/gc_safepoint/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/gc_safepoint/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/generate_column/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/kafka_message/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/kafka_sink_error_resume/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/kill_owner_with_ddl/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/kv_client_stream_reconnect/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/many_pk_or_uk/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/many_pk_or_uk/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/move_table/conf/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/move_table/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/multi_capture/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/multi_source/diff_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/multi_source/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export-fix-sql = true
check-struct-only = false

[task]
output-dir = "/tmp/ticdc_dm_test/output"
output-dir = "/tmp/tidb_cdc_test/new_ci_collation_with_old_value/sync_diff/output"

source-instances = ["mysql1"]

Expand Down
Loading

0 comments on commit 472f94a

Please sign in to comment.