Skip to content

Commit faac82a

Browse files
authored
Updates -- fix pt for show replica command change, and mysql default … (#403)
* Updates -- fix pt for show replica command change, and mysql default create user password plugin
1 parent 359a2e0 commit faac82a

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

backup_tests/inc_backup_load_tests.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ normalize_version() {
7777
VER=$($mysqldir/bin/mysqld --version | awk -F 'Ver ' '{print $2}' | grep -oe '[0-9]\.[0-9][\.0-9]*' | head -n1)
7878
VERSION=$(normalize_version $VER)
7979

80+
# Check PT Checksum tools compatibility for 8.0 or 8.4
81+
if ! command -v pt-table-checksum &>/dev/null; then
82+
echo "ERROR: pt-table-checksum is not installed" >&2
83+
exit 1
84+
fi
85+
pt_ver=$(pt-table-checksum --version 2>/dev/null | awk '{print $NF}')
86+
# Version-specific requirements
87+
if [ "$VERSION" -ge "080000" ] && [ "$VERSION" -lt "080400" ] && [ $(normalize_version "$pt_ver") -lt $(normalize_version "3.0.9") ]; then
88+
echo "ERROR: MySQL 8.0 requires pt-table-checksum 3.0.9 or later (but found $pt_ver)"
89+
exit 1
90+
elif [ "$VERSION" -ge "080400" ] && [ $(normalize_version "$pt_ver") -lt $(normalize_version "3.7.0") ]; then
91+
echo "ERROR: MySQL 8.4 and higher versions requires pt-table-checksum 3.7.0 or later (but found $pt_ver)"
92+
exit 1
93+
fi
94+
8095
# Set Kmip configuration
8196
setup_kmip() {
8297
# Remove existing container if any

backup_tests/xbstream_fifo_test.sh

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ start_minio() {
9696
-v ~/minio/data:/data \
9797
-e "MINIO_ROOT_USER=admin" \
9898
-e "MINIO_ROOT_PASSWORD=password" \
99-
quay.io/minio/minio server /data --console-address ":9001"
99+
minio/minio:latest server /data --console-address ":9001"
100100
fi
101101
fi
102102

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

233233
sysbench_create_load() {
234+
# Get MySQL version
235+
MYSQL_VERSION_OUTPUT=$($PS_DIR/bin/mysqld --version 2>/dev/null)
236+
237+
if [ $? -ne 0 ]; then
238+
echo "Error: Could not get MySQL version"
239+
exit 1
240+
fi
241+
242+
# Extract full version number
243+
MYSQL_VERSION=$(echo "$MYSQL_VERSION_OUTPUT" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
244+
245+
if [ -z "$MYSQL_VERSION" ]; then
246+
echo "Error: Could not parse MySQL version"
247+
exit 1
248+
fi
249+
250+
echo "Detected MySQL version: $MYSQL_VERSION"
251+
252+
# Convert version to numeric for easy comparison (e.g., 8.0.35 becomes 80035, 5.7.44 becomes 50744)
253+
VERSION_NUMERIC=$(echo "$MYSQL_VERSION" | awk -F. '{printf "%d%02d%02d", $1, $2, $3}')
254+
TARGET_VERSION=80000 # 8.0.0
234255
# Create user
235-
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED WITH mysql_native_password BY 'test';"
256+
if [ "$VERSION_NUMERIC" -ge "$TARGET_VERSION" ]; then
257+
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED BY 'test';"
258+
else
259+
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "CREATE USER sysbench@'%' IDENTIFIED WITH mysql_native_password BY 'test';"
260+
fi
236261
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "GRANT ALL ON *.* TO sysbench@'%';"
237262
$PS_DIR/bin/mysql -A -uroot -S $SOCKET -e "DROP DATABASE IF EXISTS sbtest;CREATE DATABASE sbtest;"
238263

0 commit comments

Comments
 (0)