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.
fix ddl bugs; support check dispatcher count to test more precisely (p…
- Loading branch information
1 parent
62e12ff
commit b3e2a5a
Showing
27 changed files
with
672 additions
and
393 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
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
18 changes: 18 additions & 0 deletions
18
tests/integration_tests/_utils/check_coordinator_and_maintainer
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/bash | ||
# parameter 1: ip addr with port | ||
# parameter 2: changefeed id | ||
# parameter 3: retry count | ||
|
||
# this script is used to check the coordinator and maintainer is all existed in the target node. | ||
# we use query_dispatcher_count to check when we query, there is no maintainer is not found error. | ||
# which means the maintainer and the coordinator exists in the node. | ||
|
||
set -ex | ||
|
||
ipAddr=${1} | ||
changefeedID=${2} | ||
retryCount=${3} | ||
|
||
echo "check coordinator and maintainer" | ||
|
||
query_dispatcher_count ${ipAddr} ${changefeedID} -1 ${retryCount} |
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,29 @@ | ||
#!/bin/bash | ||
|
||
# the script is used to get tableid based on the table name | ||
|
||
# parameter 1: db name | ||
# parameter 2: table name | ||
# parameter 3: retry count | ||
|
||
set -ex | ||
|
||
dbName=${1} | ||
tableName=${2} | ||
|
||
MAX_RETRIES=5 | ||
retries=0 | ||
|
||
while [ $retries -lt $MAX_RETRIES ]; do | ||
id=$(curl http://127.0.0.1:10080/schema/"${dbName}"/"${tableName}" | jq .id) | ||
if [ -n "$id" ]; then | ||
echo $id | ||
exit 0 | ||
fi | ||
retries=$((retries+1)) | ||
sleep 1 | ||
done | ||
|
||
|
||
echo "Failed to get table id" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
# parameter 1: ip addr with port | ||
# parameter 2: changefeed id | ||
# parameter 3: target count, if target count is -1, means the target count is not important, just not to be null | ||
# parameter 4: retry count | ||
|
||
set -ex | ||
|
||
ipAddr=${1} | ||
changefeedID=${2} | ||
target=${3} | ||
retryCount=${4} | ||
|
||
echo "query dispatcher count" | ||
count=0 | ||
|
||
while [[ $count -lt $retryCount ]]; do | ||
ans=$(curl -X GET http://"${ipAddr}"/api/v2/changefeeds/"${changefeedID}"/get_dispatcher_count) | ||
echo $ans | ||
value=$(echo $ans | jq -r '.count') | ||
|
||
if [ "$target" == "-1" ]; then | ||
if [ "$value" != "null" ]; then | ||
exit 0 | ||
fi | ||
else | ||
if [ "$value" == "$target" ]; then | ||
exit 0 | ||
fi | ||
fi | ||
|
||
sleep 2 | ||
|
||
count=$((count + 1)) | ||
done | ||
|
||
echo "query dispatcher count $retryCount retries, final value: $value, target: $target" | ||
exit 1 |
Oops, something went wrong.