Repository navigation
tests: support cloud-engine next gen startup #4661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,15 @@ if [ -z "$OUT_DIR" ]; then | |
| exit 1 | ||
| fi | ||
|
|
||
| echo "Checking TiKV version information..." | ||
| tikvVersionInfo=$(tikv-server -V 2>&1) | ||
| printf '%s\n' "$tikvVersionInfo" | ||
| tikvGitCommitBranch=$(printf '%s\n' "$tikvVersionInfo" | sed -nE 's/^Git Commit Branch:[[:space:]]*([^[:space:]]+).*$/\1/p' | head -n 1) | ||
| tikvNeedsCdcEnable=false | ||
| if [ "$tikvGitCommitBranch" = "cloud-engine" ]; then | ||
| tikvNeedsCdcEnable=true | ||
| fi | ||
|
|
||
| # start minio | ||
| echo "Starting MinIO server..." | ||
| mkdir -p "$TEST_DATA_DIR/minio" | ||
|
|
@@ -221,6 +230,12 @@ lightweight-backup = true | |
| target-file-size = "512MB" | ||
| wal-chunk-target-file-size = "128MB" | ||
| EOF | ||
| if [ "$tikvNeedsCdcEnable" = "true" ]; then | ||
| cat >>"$OUT_DIR/upstream-tikv.toml" <<EOF | ||
| [cdc] | ||
| enable = true | ||
| EOF | ||
| fi | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tenfyzhong PTAL. I think BDR mode needs this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment is outdated. I have added the same configuration to the downstream config file on line 263. |
||
|
|
||
| touch "$OUT_DIR/downstream-tikv.toml" | ||
| if [ -f "$tikv_config" ]; then | ||
|
|
@@ -249,7 +264,6 @@ EOF | |
| echo "Starting upstream TiKV..." | ||
| mkdir -p "$TEST_DATA_DIR/upstream" | ||
| mkdir -p "$OUT_DIR/log/upstream/tikv" | ||
| tikv-server --version | ||
| for idx in $(seq 1 3); do | ||
| host="UP_TIKV_HOST_$idx" | ||
| port="UP_TIKV_PORT_$idx" | ||
|
|
@@ -269,7 +283,6 @@ done | |
| echo "Starting downstream TiKV..." | ||
| mkdir -p "$TEST_DATA_DIR/downstream" | ||
| mkdir -p "$OUT_DIR/log/downstream/tikv" | ||
| tikv-server --version | ||
| tikv-server \ | ||
| --pd "${DOWN_PD_HOST}:${DOWN_PD_PORT}" \ | ||
| -A "${DOWN_TIKV_HOST}:${DOWN_TIKV_PORT}" \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for detecting the TiKV branch and determining if CDC needs to be enabled is duplicated in
tests/integration_tests/_utils/start_tls_tidb_cluster_impl_nextgen. To improve maintainability and ensure consistency across different test startup scripts, consider extracting this logic into a shared function or a common utility script.