-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync-diff: make sure user setting can cover the default same table ro…
- Loading branch information
Showing
11 changed files
with
546 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# argument 1 is the string need grep | ||
# argument 2 is the filename | ||
# argument 3 is the match count | ||
|
||
set -eu | ||
OUT_DIR=/tmp/tidb_tools_test | ||
|
||
count=$(grep -F "$1" "$2" | wc -l) | ||
|
||
if [ "$count" -ne "$3" ]; then | ||
echo "TEST FAILED: '$2' DOES NOT CONTAIN '$1' $3 times" | ||
echo "____________________________________" | ||
cat "$2" | ||
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Diff Configuration. | ||
|
||
######################### Global config ######################### | ||
|
||
|
||
# how many goroutines are created to check data | ||
check-thread-count = 4 | ||
|
||
# set false if just want compare data by checksum, will skip select data when checksum is not equal. | ||
# set true if want compare all different rows, will slow down the total compare time. | ||
export-fix-sql = true | ||
|
||
# ignore check table's data | ||
check-struct-only = false | ||
|
||
|
||
######################### Databases config ######################### | ||
[data-sources.mysql1] | ||
host = "127.0.0.1"#MYSQL_HOST | ||
port = 3306#MYSQL_PORT | ||
user = "root" | ||
password = "" | ||
|
||
route-rules = ["rule1"] | ||
# remove comment if use tidb's snapshot data | ||
# snapshot = "2016-10-08 16:45:26" | ||
|
||
[data-sources.tidb] | ||
host = "127.0.0.1"#MYSQL_HOST | ||
port = 3306#MYSQL_HOST | ||
user = "root" | ||
password = "" | ||
# remove comment if use tidb's snapshot data | ||
# snapshot = "2016-10-08 16:45:26" | ||
|
||
[routes.rule1] | ||
schema-pattern = "router_test_0" | ||
table-pattern = "tbl" | ||
target-schema = "router_test_1" | ||
target-table = "tbl" | ||
|
||
######################### Task config ######################### | ||
[task] | ||
# 1 fix sql: fix-target-TIDB1.sql | ||
# 2 log: sync-diff.log | ||
# 3 summary: summary.txt | ||
# 4 checkpoint: a dir | ||
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" | ||
|
||
source-instances = ["mysql1"] | ||
|
||
target-instance = "tidb" | ||
|
||
# tables need to check. | ||
target-check-tables = ["router_test_1.tbl"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Diff Configuration. | ||
|
||
######################### Global config ######################### | ||
|
||
|
||
# how many goroutines are created to check data | ||
check-thread-count = 4 | ||
|
||
# set false if just want compare data by checksum, will skip select data when checksum is not equal. | ||
# set true if want compare all different rows, will slow down the total compare time. | ||
export-fix-sql = true | ||
|
||
# ignore check table's data | ||
check-struct-only = false | ||
|
||
|
||
######################### Databases config ######################### | ||
[data-sources.mysql1] | ||
host = "127.0.0.1"#MYSQL_HOST | ||
port = 3306#MYSQL_PORT | ||
user = "root" | ||
password = "" | ||
|
||
route-rules = ["rule1"] | ||
# remove comment if use tidb's snapshot data | ||
# snapshot = "2016-10-08 16:45:26" | ||
|
||
[data-sources.tidb] | ||
host = "127.0.0.1"#MYSQL_HOST | ||
port = 3306#MYSQL_HOST | ||
user = "root" | ||
password = "" | ||
# remove comment if use tidb's snapshot data | ||
# snapshot = "2016-10-08 16:45:26" | ||
|
||
[routes.rule1] | ||
schema-pattern = "router_test_0" | ||
target-schema = "router_test_1" | ||
|
||
######################### Task config ######################### | ||
[task] | ||
# 1 fix sql: fix-target-TIDB1.sql | ||
# 2 log: sync-diff.log | ||
# 3 summary: summary.txt | ||
# 4 checkpoint: a dir | ||
output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" | ||
|
||
source-instances = ["mysql1"] | ||
|
||
target-instance = "tidb" | ||
|
||
# tables need to check. | ||
target-check-tables = ["router_test_1.tbl"] |
Oops, something went wrong.