You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The binlog replay helper can let tests pass without verification because it ignores replay command failures and skips comparisons when required replay metadata is missing.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved verification defects can produce false mismatches during concurrent writes, fail RocksDB backup tests, and report success even when restored tables are missing.
Please also accept the eight-column output used by older pt-table-checksum releases, including 3.0.9, which check_pt_checksum() explicitly permits for MySQL 8.0. That format has no DIFF_ROWS column, so valid table rows are discarded here and the new empty-output safeguard fails the test before restore. Accept both layouts and read TABLE from the final column.
The reason will be displayed to describe this comment to others. Learn more.
Thanks Tomislav for the fixes. I ran the tests with MS9.7.2 and PS9.7.2, adding some more suggestions.
Scenario: Run pxb tests with MS9.7.2, rocksdb is disabled by default
export TEST_BASE_DIR=$HOME/innodb_myrocks_backup_tests
export XTRABACKUP_DIR=$HOME/percona-xtrabackup-9.7.2-2-Linux-x86_64.glibc2.35/bin
export MYSQLDIR=$HOME/Mysql-9.7.2-copy
export QASCRIPTS=$HOME/server-qa
export ENABLE_CORE_DUMP=1
python innodb_myrocks_backup_tests.py -v Various_ddl_tests
innodb_myrocks_backup_tests.py::test_add_drop_index RocksDB is unsupported in MS, disabling RocksDB for this test
###################################################################################
# Test: test_add_drop_index
###################################################################################
=>Creating data directory for 'primary'
..Data directory '/home/manish.chawla/innodb_myrocks_backup_tests/data_add-drop-index_20261105_045148' created
=>Starting MySQL server 'primary' on port 21000
..Server 'primary' started successfully
Test is running against: MS-9.7.2
Run sysbench on database=test time=20
DDL: Add and drop index on test.sbtest1
=>Taking full backup
..Full backup was successfully created at: /home/manish.chawla/innodb_myrocks_backup_tests/dbbackup_add-drop-index_20261105_045148/full.
Logs available at: /home/manish.chawla/innodb_myrocks_backup_tests/backuplogs_add-drop-index_20261105_045148/full_backup_20261105_045206_log
=>Taking incremental backup: 1
..Inc backup was successfully created at: /home/manish.chawla/innodb_myrocks_backup_tests/dbbackup_add-drop-index_20261105_045148/inc1.
Logs available at: /home/manish.chawla/innodb_myrocks_backup_tests/backuplogs_add-drop-index_20261105_045148/inc1_backup_20261105_045206_log
Waiting for DDL threads to finish: ddl_ddl_add_drop_index
=>Preparing full backup
..Prepare of full backup was successful.
Logs available at: /home/manish.chawla/innodb_myrocks_backup_tests/backuplogs_add-drop-index_20261105_045148/prepare_full_backup_20261105_045206_log
=>Preparing incremental backup: 1
..Prepare of incremental backup was successful.
Logs available at: /home/manish.chawla/innodb_myrocks_backup_tests/backuplogs_add-drop-index_20261105_045148/prepare_inc1_backup_20261105_045206_log
Collecting existing table count
Stopping mysql server and moving data directory
..Server 'primary' shut down cleanly
=>Restoring full backup
..Restore of full backup was successful.
Logs available at: /home/manish.chawla/innodb_myrocks_backup_tests/backuplogs_add-drop-index_20261105_045148/res_backup_20261105_045206_log
=>Starting MySQL server 'primary' on port 21000
..Server 'primary' started successfully
Check xtrabackup for binlog position
Xtrabackup binlog position: binlog.000004, 23979
Applying binlog to restored data starting from binlog.000004, 23979
Collecting table count after restore
Data is the same before and after restore: Pass
PASSED
It mentions that Waiting for DDL threads to finish: ddl_ddl_add_drop_index. Is it possible to remove the extra ddl word here?
All table checks are not being run after restore. These checks should be added
a) Check tables for corruption. This is the bash code
for ((i=1; i<=${num_tables}; i++)); do
for database in ${database_list}; do
if ! table_status=$(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "CHECK TABLE $database.sbtest$i"|cut -f4-); then
echo "ERR: CHECK TABLE $database.sbtest$i query failed"
# Check if database went down
if ! ${mysqldir}/bin/mysqladmin ping --user=root --socket=${mysqldir}/socket.sock >/dev/null 2>&1; then
echo "ERR: The database has gone down due to corruption in table $database.sbtest$i"
exit 1
fi
check_err=1
fi
if [[ "$table_status" != "OK" ]]; then
echo "ERR: CHECK TABLE $database.sbtest$i query displayed the table status as '$table_status'"
check_err=1
fi
done
done
# Check if database went down
if ! ${mysqldir}/bin/mysqladmin ping --user=root --socket=${mysqldir}/socket.sock >/dev/null 2>&1; then
echo "ERR: The database has gone down due to corruption, the restore was unsuccessful"
exit 1
fi
if [[ "$check_err" -eq 0 ]]; then
echo "All innodb and myrocks tables status: OK"
else
echo "After restore, some tables may be corrupt, check table status is not OK"
fi
b) Check record count of each table, it should be same before and after restore. The bash code for this is
echo "Check the record count of tables in databases: ${database_list}"
# Get record count for each table in databases test and test_rocksdb
rc_err=0
checksum_err=0
for ((i=1; i<=${num_tables}; i++)); do
rc_innodb_res[$i]=$(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "SELECT COUNT(*) FROM test.sbtest$i;")
if [[ "${rc_innodb_orig[$i]}" -ne "${rc_innodb_res[$i]}" ]]; then
echo "ERR: The record count of test.sbtest$i changed after restore. Record count in original data: ${rc_innodb_orig[$i]}. Record count in restored data: ${rc_innodb_res[$i]}."
rc_err=1
fi
if [[ "${rocksdb}" = "enabled" ]] && [[ "${MYSQLD_OPTIONS}" != *"keyring"* ]]; then
rc_myrocks_res[$i]=$(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "SELECT COUNT(*) FROM test_rocksdb.sbtest$i;")
if [[ "${rc_myrocks_orig[$i]}" -ne "${rc_myrocks_res[$i]}" ]]; then
echo "ERR: The record count of test_rocksdb.sbtest$i changed after restore. Record count in original data: ${rc_myrocks_orig[$i]}. Record count in restored data: ${rc_myrocks_res[$i]}."
rc_err=1
fi
fi
done
if [[ "$rc_err" -eq 0 ]]; then
echo "Match record count of tables in databases ${database_list} with original data: Pass"
fi
c) Check checksum of each table, it should be same before and after restore. The bash code for this is
echo "Check the checksum of each table in databases: ${database_list}"
# Get checksum of each table in databases test and test_rocksdb
for ((i=1; i<=${num_tables}; i++)); do
chk_innodb_res[$i]=$(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "CHECKSUM TABLE test.sbtest$i;"|awk '{print $2}')
if [[ "${chk_innodb_orig[$i]}" -ne "${chk_innodb_res[$i]}" ]]; then
echo "ERR: The checksum of test.sbtest$i changed after restore. Checksum in original data: ${chk_innodb_orig[$i]}. Checksum in restored data: ${chk_innodb_res[$i]}."
checksum_err=1;
fi
if [[ "${rocksdb}" = "enabled" ]] && [[ "${MYSQLD_OPTIONS}" != *"keyring"* ]]; then
chk_myrocks_res[$i]=$(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "CHECKSUM TABLE test_rocksdb.sbtest$i;"|awk '{print $2}')
if [[ "${chk_myrocks_orig[$i]}" -ne "${chk_myrocks_res[$i]}" ]]; then
echo "ERR: The checksum of test_rocksdb.sbtest$i changed after restore. Checksum in original data: ${chk_myrocks_orig[$i]}. Checksum in restored data: ${chk_myrocks_res[$i]}."
checksum_err=1;
fi
fi
done
if [[ "$checksum_err" -eq 0 ]]; then
echo "Match checksum of all tables in databases ${database_list} with original data: Pass"
fi
d) Check for gaps in primary sequence id of tables. This is optional, since the above checks should be sufficient
echo "Check for gaps in primary sequence id of tables"
gap_found=0
#for database in test test_rocksdb; do
for database in ${database_list}; do
for ((i=1; i<=${num_tables}; i++)); do
j=1
while read line; do
if [[ "$line" != "$j" ]]; then
echo "ERR: Gap found in $database.sbtest$i. Expected sequence number for ID is: $j. Actual sequence number for ID is: $line."
gap_found=1
return
fi
let j++
done < <(${mysqldir}/bin/mysql -uroot -S${mysqldir}/socket.sock -Bse "SELECT id FROM $database.sbtest$i ORDER BY id ASC")
done
done
if [[ "$gap_found" -eq 0 ]]; then
echo "No gaps found in primary sequence id of tables: Pass"
fi
}
We skip record count and checksum comparison, in case binlog is encrypted and binlogs can't be applied to the restore, but tables are always checked for corruption.
Scenario: Explicit rocksdb disabled/enabled (export ROCKSDB=disabled/enabled)
Each test pauses when the test is started and prints all the output after the test is completed, so it doesn't display how the test is proceeding.
Thanks Tomislav, I found some more issues in the meanwhile. In the tests test_inc-backup-archive and test_inc_backup_innodb_params, if rocksdb is enabled, then the rocksdb data doesn't get created. I think during initialization CREATE DATABASE test_rocksdb; needs to be added.
These are the errors coming in sysbench logs:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.