1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-742 test correction.

Fixed XA-ROLLBACK not to write into binlog when XA-prepare run
in sql_log_bin-OFF environment. (Two tests affected).
This commit is contained in:
Andrei Elkin
2020-03-15 14:14:35 +02:00
parent 8e5ae4e4df
commit 345e21d2eb
3 changed files with 22 additions and 27 deletions

View File

@@ -201,23 +201,21 @@ connection master;
xa recover; xa recover;
formatID gtrid_length bqual_length data formatID gtrid_length bqual_length data
1 11 0 skip_binlog 1 11 0 skip_binlog
connection master; set @@session.sql_log_bin = OFF;
call mtr.add_suppression("Slave: XAER_NOTA: Unknown XID");
xa rollback 'skip_binlog'; xa rollback 'skip_binlog';
set @@session.sql_log_bin = ON;
include/save_master_gtid.inc
*** Zero must be in the list: *** Zero must be in the list:
connection master; connection master;
xa recover; xa recover;
formatID gtrid_length bqual_length data formatID gtrid_length bqual_length data
*** At the end of --binlog-ignore-db section gtid list has 2 more: *** At the end of skip_log_binb section gtid list has 0 more:
flush logs; flush logs;
show binlog events in 'master-bin.000007' limit 1,1; show binlog events in 'master-bin.000007' limit 1,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000007 # Gtid_list 1 # [0-1-27] master-bin.000007 # Gtid_list 1 # [0-1-25]
include/save_master_gtid.inc
connection slave; connection slave;
include/wait_for_slave_sql_error.inc [errno=1397] include/sync_with_master_gtid.inc
set @@global.sql_slave_skip_counter= 1;
include/start_slave.inc
connection master; connection master;
drop database test_ign; drop database test_ign;
drop table t1, t2, t3, tm; drop table t1, t2, t3, tm;

View File

@@ -210,23 +210,21 @@ connection master;
xa recover; xa recover;
formatID gtrid_length bqual_length data formatID gtrid_length bqual_length data
1 11 0 skip_binlog 1 11 0 skip_binlog
connection master; set @@session.sql_log_bin = OFF;
call mtr.add_suppression("Slave: XAER_NOTA: Unknown XID");
xa rollback 'skip_binlog'; xa rollback 'skip_binlog';
set @@session.sql_log_bin = ON;
include/save_master_gtid.inc
*** Zero must be in the list: *** Zero must be in the list:
connection master; connection master;
xa recover; xa recover;
formatID gtrid_length bqual_length data formatID gtrid_length bqual_length data
*** At the end of --binlog-ignore-db section gtid list has 2 more: *** At the end of skip_log_binb section gtid list has 0 more:
flush logs; flush logs;
show binlog events in 'master-bin.000007' limit 1,1; show binlog events in 'master-bin.000007' limit 1,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000007 # Gtid_list 1 # [0-1-27] master-bin.000007 # Gtid_list 1 # [0-1-25]
include/save_master_gtid.inc
connection slave; connection slave;
include/wait_for_slave_sql_error.inc [errno=1397] include/sync_with_master_gtid.inc
set @@global.sql_slave_skip_counter= 1;
include/start_slave.inc
connection master; connection master;
drop database test_ign; drop database test_ign;
drop table t1, t2, t3, tm; drop table t1, t2, t3, tm;

View File

@@ -308,8 +308,8 @@ flush logs;
--source include/show_gtid_list.inc --source include/show_gtid_list.inc
# B. Session binlog disable does not log even empty XA-prepare but XA-complete will be # B. Session binlog disable does not log even empty XA-prepare
# logged despite of that. # Therefore XA-complete should be also run in sql_log_bin-OFF environment.
--let $db=test --let $db=test
--let $xid=skip_binlog --let $xid=skip_binlog
@@ -328,28 +328,27 @@ set @@session.sql_log_bin = OFF;
--connection master --connection master
xa recover; xa recover;
--connection master # now commit it carefully to avoid binlogging as the prepare part did
call mtr.add_suppression("Slave: XAER_NOTA: Unknown XID"); set @@session.sql_log_bin = OFF;
--eval xa rollback '$xid' --eval xa rollback '$xid'
set @@session.sql_log_bin = ON;
--source include/save_master_gtid.inc
--echo *** Zero must be in the list: --echo *** Zero must be in the list:
--connection master --connection master
xa recover; xa recover;
--echo *** At the end of --binlog-ignore-db section gtid list has 2 more: --echo *** At the end of skip_log_binb section gtid list has 0 more:
flush logs; flush logs;
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--source include/show_gtid_list.inc --source include/show_gtid_list.inc
--source include/save_master_gtid.inc
# #
# Expected error on slave and manual correction # sync slave successfully to prove its consistency
# #
--connection slave --connection slave
let $slave_sql_errno= 1397; # ER_XAER_NOTA source include/sync_with_master_gtid.inc;
source include/wait_for_slave_sql_error.inc;
set @@global.sql_slave_skip_counter= 1;
--source include/start_slave.inc
connection master; connection master;
--eval drop database test_ign --eval drop database test_ign