From eeb684221dd4e473d3aa1c95ba75cd54b76bbcd3 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Tue, 3 Apr 2018 16:30:58 +0200 Subject: [PATCH] MDEV-13549 Fix and re-enable MTR test galera.galera_gra_log Test galera checks that a `GRA_x_x.log` file is created whenever wsrep applier fails to apply some replication event. The file contains the corresponding binlog event that failed to apply. The test creates a new file by concatenating a pre-recorded file containing the binlog header (see `std-data/binlog-header.log`) and the `GRA_x_x.log` file. The test then checks that the resulting file, containing the binlog header and the event that failed to apply, is correctly read by `mysqlbinlog` program. The test fails in MariaDB because the GRA_x_x.log file created by MariaDB already contains the binlog header (see MDEV-7867). This patch fixes/simplifies test `galera.galera_gra_log` so that it doesn't concatenate `std-data/binlog-header.log` with the `GRA_x_x.log` file. File `std-data/binlog-header.log` is deleted altoghether, because not used by any other test. --- mysql-test/std_data/binlog-header.log | Bin 120 -> 0 bytes mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/r/galera_gra_log.result | 13 ++----------- mysql-test/suite/galera/t/galera_gra_log.test | 13 +++---------- 4 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 mysql-test/std_data/binlog-header.log diff --git a/mysql-test/std_data/binlog-header.log b/mysql-test/std_data/binlog-header.log deleted file mode 100644 index c415a57e61612b723f773414898f9dcf0871f98e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmeyDl$p1y@<1p*69WT72@qERF(U&DgQ=dGo{@=eN@`MRx^7N>I#8GZ02w1}!OOtG kAjH4|1VRi9F$^qH96)Ux92_9?xwyC_B^ekN=c)b#0H!YxNdN!< diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 38fdc50f14d..9d4e90c19e9 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -9,7 +9,6 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -galera_gra_log : MDEV-13549 Galera test failures galera_flush : MDEV-13549 Galera test failures galera_account_management : MariaDB 10.0 does not support ALTER USER galera_binlog_row_image : MariaDB 10.0 does not support binlog_row_image diff --git a/mysql-test/suite/galera/r/galera_gra_log.result b/mysql-test/suite/galera/r/galera_gra_log.result index 9f5cbdd75fc..6b816d0127f 100644 --- a/mysql-test/suite/galera/r/galera_gra_log.result +++ b/mysql-test/suite/galera/r/galera_gra_log.result @@ -8,22 +8,13 @@ COUNT(*) = 0 /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -# at 4 - server id 2 end_log_pos 120 Start: binlog v 4, server v 5.6.24-debug-log created 150804 11:37:14 at startup -# Warning: this binlog is either in use or was not closed properly. ROLLBACK/*!*/; -BINLOG ' -unnAVQ8CAAAAdAAAAHgAAAABAAQANS42LjI0LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAAC6ecBVEzgNAAgAEgAEBAQEEgAAXAAEGggAAAAICAgCAAAACgoKGRkAAKNu -Jfk= -'/*!*/; -# at 120 - server id 1 end_log_pos 91 Query thread_id= exec_time=0 error_code=0 +ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=/*!*/; SET @@session.pseudo_thread_id=/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; -SET @@session.sql_mode=1073741824/*!*/; +SET @@session.sql_mode=1342177280/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; diff --git a/mysql-test/suite/galera/t/galera_gra_log.test b/mysql-test/suite/galera/t/galera_gra_log.test index 5329dc24546..adb37de9188 100644 --- a/mysql-test/suite/galera/t/galera_gra_log.test +++ b/mysql-test/suite/galera/t/galera_gra_log.test @@ -19,17 +19,10 @@ CREATE TABLE t1 (f1 INTEGER); --connection node_2 SELECT COUNT(*) = 0 FROM t1; -# Compose a valid binlog from a header file and the GRA file +# Make sure the GRA file produced is readable and contains the failure ---let $gra_binlog_file = $MYSQLTEST_VARDIR/tmp/gra.log ---exec rm -rf $gra_binlog_file - ---exec cp std_data/binlog-header.log $gra_binlog_file ---exec cat $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log >> $gra_binlog_file - -# Make sure the binlog thus produced is readable and contains the failure ---replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=/ /#[0-9]+ +[0-9]+:[0-9]+:[0-9]+// /pseudo_thread_id=[0-9]+/pseudo_thread_id=/ /thread_id=[0-9]+/thread_id=/ ---exec $MYSQL_BINLOG $gra_binlog_file +--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=/ +--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log SET SESSION wsrep_on=ON;