diff --git a/backup_tests/inc_backup_load_tests.sh b/backup_tests/inc_backup_load_tests.sh index e0acbbf2..4aabd700 100755 --- a/backup_tests/inc_backup_load_tests.sh +++ b/backup_tests/inc_backup_load_tests.sh @@ -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 diff --git a/backup_tests/xbstream_fifo_test.sh b/backup_tests/xbstream_fifo_test.sh index 6bc35d49..1f9a5ab2 100755 --- a/backup_tests/xbstream_fifo_test.sh +++ b/backup_tests/xbstream_fifo_test.sh @@ -96,7 +96,7 @@ 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 @@ -104,7 +104,7 @@ start_minio() { 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 "." @@ -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;"