Skip to content

Updates -- fix pt for show replica command change, and mysql default … #403

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions backup_tests/inc_backup_load_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ normalize_version() {
VER=$($mysqldir/bin/mysqld --version | awk -F 'Ver ' '{print $2}' | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1)
VERSION=$(normalize_version $VER)

# Check PT Checksum tools compatibility for 8.0 or 8.4
if ! command -v pt-table-checksum &>/dev/null; then
echo "ERROR: pt-table-checksum is not installed" >&2
exit 1
fi
pt_ver=$(pt-table-checksum --version 2>/dev/null | awk '{print $NF}')
# Version-specific requirements
if [ "$VERSION" -ge "080000" ] || [ "$VERSION" -lt "080400" ] && [ $(normalize_version "$pt_ver") -lt $(normalize_version "3.0.9") ]; then
echo "ERROR: MySQL 8.0 requires pt-table-checksum 3.0.9 or later (but found $pt_ver)"
exit 1
elif [ "$VERSION" -ge "080400" ] && [ $(normalize_version "$pt_ver") -lt $(normalize_version "3.7.0") ]; then
echo "ERROR: MySQL 8.4 and higher versions requires pt-table-checksum 3.7.0 or later (but found $pt_ver)"
exit 1
fi

# Set Kmip configuration
setup_kmip() {
# Remove existing container if any
Expand Down
31 changes: 28 additions & 3 deletions backup_tests/xbstream_fifo_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ start_minio() {
-v ~/minio/data:/data \
-e "MINIO_ROOT_USER=admin" \
-e "MINIO_ROOT_PASSWORD=password" \
quay.io/minio/minio server /data --console-address ":9001"
minio/minio:latest server /data --console-address ":9001"
fi
fi

# Poll the health endpoint
echo -n "Waiting for MinIO to become ready"
for i in {1..20}; do
if curl -s -o /dev/null -w "%{http_code}" http://localhost:9000/minio/health/ready | grep -q 200; then
echo -n "\n MinIO is ready!"
echo -e "\n MinIO is ready!\n"
return
fi
echo -n "."
Expand Down Expand Up @@ -231,8 +231,33 @@ start_server() {
}

sysbench_create_load() {
# Get MySQL version
MYSQL_VERSION_OUTPUT=$($PS_DIR/bin/mysqld --version 2>/dev/null)

if [ $? -ne 0 ]; then
echo "Error: Could not get MySQL version"
exit 1
fi

# Extract full version number
MYSQL_VERSION=$(echo "$MYSQL_VERSION_OUTPUT" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)

if [ -z "$MYSQL_VERSION" ]; then
echo "Error: Could not parse MySQL version"
exit 1
fi

echo "Detected MySQL version: $MYSQL_VERSION"

# Convert version to numeric for easy comparison (e.g., 8.0.35 becomes 80035, 5.7.44 becomes 50744)
VERSION_NUMERIC=$(echo "$MYSQL_VERSION" | awk -F. '{printf "%d%02d%02d", $1, $2, $3}')
TARGET_VERSION=80000 # 8.0.0
# Create user
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED WITH mysql_native_password BY 'test';"
if [ "$VERSION_NUMERIC" -ge "$TARGET_VERSION" ]; then
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED BY 'test';"
else
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED WITH mysql_native_password BY 'test';"
fi
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "GRANT ALL ON *.* TO sysbench@'%';"
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "DROP DATABASE IF EXISTS sbtest;CREATE DATABASE sbtest;"

Expand Down