-
Notifications
You must be signed in to change notification settings - Fork 293
Description
Description:
I encountered an issue with the scripts/download-integration-test-binaries.sh
script while running integration tests for TiCDC. This script is responsible for downloading the necessary binaries for the integration tests. In particular, it attempts to download and extract the PD binaries using the following commands:
download "$pd_download_url" "pd-server.tar.gz" "tmp/pd-server.tar.gz"
tar -xz -C third_bin 'bin/*' -f tmp/pd-server.tar.gz && mv third_bin/bin/* third_bin/
The intent here is to extract all the executable files located under the bin
directory in the pd-server.tar.gz
package. However, the script may fail when running on systems with certain versions of tar
. The executable files located under the bin
directory in the pd-server.tar.gz
package:
Problem:
The issue arises because not all versions of tar
support wildcard extraction by default. Specifically, the command:
tar -xz -C third_bin 'bin/*' -f tmp/pd-server.tar.gz
uses the wildcard 'bin/*'
to match all files under the bin
directory in the package. While this works on some systems, other versions of tar
(typically older or non-GNU implementations) do not enable wildcard matching by default. To ensure that tar
interprets the wildcard patterns correctly, the --wildcards
option needs to be explicitly included. Without this option, the extraction fails, leaving no PD executables in the third_bin
directory.
Impact:
As a result, when the script fails to extract the PD binaries correctly, it leaves the third_bin
directory empty of PD-related executables, causing the integration tests to fail since the required binaries are missing.
Suggested Fix:
To address this issue, we should modify the tar
extraction command to include the --wildcards
option, ensuring that the wildcard pattern is correctly interpreted across all versions of tar
. The updated command would look like this:
tar -xz --wildcards -C third_bin 'bin/*' -f tmp/pd-server.tar.gz
This ensures that the script works consistently across different environments and tar
implementations.
Versions of the cluster
TiCDC version (execute cdc version
):
8.3.0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status