forked from pingcap/ticdc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add fail over ddl test case L (pingcap#795)
- Loading branch information
1 parent
07103f7
commit a1a38ba
Showing
17 changed files
with
550 additions
and
369 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# parameter 1: ip addr with port | ||
# parameter 2: table id | ||
# parameter 3: changefeed id | ||
# parameter 4: retry count | ||
|
||
set -e | ||
|
||
ipAddr=${1} | ||
tableID=${2} | ||
changefeedID=${3} | ||
retryCount=${4} | ||
|
||
echo "move table with retry" | ||
count=0 | ||
|
||
while [[ $count -lt $retryCount ]]; do | ||
ans=$(run_cdc_cli capture list) | ||
node2ID=$(echo $ans | sed 's/ PASS.*//' | sed 's/^=== Command to ticdc(new arch). //' | jq -r ".[] | select(.address == \"$ipAddr\") | .id") | ||
if [ -z "$node2ID" ]; then | ||
echo "Failed to extract node2 ID" | ||
continue | ||
fi | ||
|
||
# move table 1 to node2 | ||
result=$(run_cdc_cli changefeed move-table -c "$changefeedID" -t $tableID -d "$node2ID") | ||
echo $result | ||
success=$(echo $result | sed 's/ PASS.*//' | sed 's/^=== Command to ticdc(new arch). //' | jq -r '.success') | ||
|
||
if [ "$success" == "true" ]; then | ||
exit 0 | ||
fi | ||
|
||
count=$((count + 1)) | ||
done | ||
|
||
echo "move table 1 to node2 failed after $retryCount retries" | ||
exit 1 |
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
Oops, something went wrong.