diff options
author | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-09-27 10:31:24 -0600 |
---|---|---|
committer | Brandon Nesterenko <brandon.nesterenko@mariadb.com> | 2022-11-25 12:45:35 -0700 |
commit | 812443c251e163b83252638a3229cc6d48e61a5f (patch) | |
tree | ef1e892a3f8cee729dc99c65aa776d0c04fbfd4f | |
parent | 7919b14387179260c5ae0af4bff3f5ee4ae82cb6 (diff) | |
download | mariadb-git-812443c251e163b83252638a3229cc6d48e61a5f.tar.gz |
MDEV-29607: binlog.binlog_checkpoint fails in buildbot with result content mismatch
Problem:
========
There is a race condition in binlog.binlog_checkpoint between the
binlog background thread creating a binlog checkpoint event, and the
connection thread binlogging a query event for creating a table.
Because the test outputs the events for validation, the order
between these two events can be different, resulting in a failed
test.
Solution:
========
Instead of outputting the binlog events, use assert_grep to validate
the content of the binlog is correct.
Reviewed By:
============
Andrei Elkin <andrei.elkin@mariadb.com>
-rw-r--r-- | mysql-test/suite/binlog/r/binlog_checkpoint.result | 25 | ||||
-rw-r--r-- | mysql-test/suite/binlog/t/binlog_checkpoint.test | 18 |
2 files changed, 20 insertions, 23 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result index 7578a9fc6d9..a00b1c0c1a3 100644 --- a/mysql-test/suite/binlog/r/binlog_checkpoint.result +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -164,28 +164,9 @@ connection default; SET GLOBAL debug_dbug="+d,only_kill_system_threads_no_loop"; # restart ** Proof of shutdown caused ROLLBACK-completed transaction -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION -master-bin.000002 # Gtid_list # # [] -master-bin.000002 # Binlog_checkpoint # # master-bin.000001 -master-bin.000002 # Binlog_checkpoint # # master-bin.000002 -master-bin.000002 # Gtid # # GTID #-#-# -master-bin.000002 # Query # # use `test`; CREATE TABLE tm (a INT) ENGINE = myisam -master-bin.000002 # Gtid # # BEGIN GTID #-#-# -master-bin.000002 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Table \'./test/tm\' is marked as crashed' COLLATE 'latin1_swedish_ci')) -master-bin.000002 # Query # # COMMIT -master-bin.000002 # Gtid # # BEGIN GTID #-#-# -master-bin.000002 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Checking table' COLLATE 'latin1_swedish_ci')) -master-bin.000002 # Query # # COMMIT -master-bin.000002 # Gtid # # BEGIN GTID #-#-# -master-bin.000002 # Query # # use `test`; INSERT INTO tm SET a = 1 -master-bin.000002 # Query # # COMMIT -master-bin.000002 # Gtid # # BEGIN GTID #-#-# -master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (2, 1) -master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (3, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") -master-bin.000002 # Query # # ROLLBACK -master-bin.000002 # Rotate # # master-bin.000003;pos=POS +# MYSQL_BINLOG datadir/binlog_file --result-file=assert_file +include/assert_grep.inc [No XA statements should be written into the binary log] +include/assert_grep.inc [The transaction should be rolled back] SELECT * FROM tm; a 1 diff --git a/mysql-test/suite/binlog/t/binlog_checkpoint.test b/mysql-test/suite/binlog/t/binlog_checkpoint.test index 19b48ef68b0..4237f33c8af 100644 --- a/mysql-test/suite/binlog/t/binlog_checkpoint.test +++ b/mysql-test/suite/binlog/t/binlog_checkpoint.test @@ -212,7 +212,23 @@ XA END 'xa1'; --source include/start_mysqld.inc --echo ** Proof of shutdown caused ROLLBACK-completed transaction ---source include/show_binlog_events.inc + +--let assert_file=$MYSQLTEST_VARDIR/tmp/binlog_decoded.out +--let datadir=`select @@datadir` + +--echo # MYSQL_BINLOG datadir/binlog_file --result-file=assert_file +--exec $MYSQL_BINLOG $datadir/$binlog_file --result-file=$assert_file + +--let $assert_text= No XA statements should be written into the binary log +--let $assert_count= 0 +--let assert_select= XA START|XA END|XA PREPARE|XA COMMIT|XA ROLLBACK +--source include/assert_grep.inc + +--let $assert_text= The transaction should be rolled back +--let $assert_count= 1 +--let assert_select= ^ROLLBACK\$ +--source include/assert_grep.inc + SELECT * FROM tm; --eval SELECT * FROM t1 WHERE a = $a |