Commit 812443c2 authored by Brandon Nesterenko's avatar Brandon Nesterenko

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>
parent 7919b143
...@@ -164,28 +164,9 @@ connection default; ...@@ -164,28 +164,9 @@ connection default;
SET GLOBAL debug_dbug="+d,only_kill_system_threads_no_loop"; SET GLOBAL debug_dbug="+d,only_kill_system_threads_no_loop";
# restart # restart
** Proof of shutdown caused ROLLBACK-completed transaction ** Proof of shutdown caused ROLLBACK-completed transaction
include/show_binlog_events.inc # MYSQL_BINLOG datadir/binlog_file --result-file=assert_file
Log_name Pos Event_type Server_id End_log_pos Info include/assert_grep.inc [No XA statements should be written into the binary log]
master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION include/assert_grep.inc [The transaction should be rolled back]
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, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
master-bin.000002 # Query # # ROLLBACK
master-bin.000002 # Rotate # # master-bin.000003;pos=POS
SELECT * FROM tm; SELECT * FROM tm;
a a
1 1
......
...@@ -212,7 +212,23 @@ XA END 'xa1'; ...@@ -212,7 +212,23 @@ XA END 'xa1';
--source include/start_mysqld.inc --source include/start_mysqld.inc
--echo ** Proof of shutdown caused ROLLBACK-completed transaction --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; SELECT * FROM tm;
--eval SELECT * FROM t1 WHERE a = $a --eval SELECT * FROM t1 WHERE a = $a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment