mariadb/mysql-test/suite/rpl/t/rpl_start_alter_5.test
Kristian Nielsen a016b18a58 MDEV-27849: rpl.rpl_start_alter_XXX fail sporadically in buildbot
The problem is that these tests run optimistic parallel replication with
non-transactional mysql.gtid_slave_pos table. Very occasionally InnoDB stats
update may race with one another and cause a parallel replication deadlock
kill after the mysql.gtid_slave_pos table has been updated. Since
mysql.gtid_slave_pos is non-transactional, the update cannot be rolled back,
and transaction retry will fail with a duplicate key error in
mysql.gtid_slave_pos.

Fixed by altering the storage engine to InnoDB for the table.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2023-12-11 14:31:30 +01:00

55 lines
1.7 KiB
Text

#
# Start Alter with Parallel Replication
# 2 domain id
# |Concurrent alters| >= |Parallel workers on slave|
# |x| denotes number of entities it encloses
#
--source include/have_log_bin.inc
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/have_debug.inc
--connection master
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
set global binlog_alter_two_phase = ON;
set binlog_alter_two_phase = ON;
--connection slave
--let $gtid_strict_mode= `select @@gtid_strict_mode`
--let $slave_parallel_threads= `select @@slave_parallel_threads`
--let $slave_parallel_mode= `select @@slave_parallel_mode`
set global gtid_strict_mode=1;
--connection slave
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=4;
set global slave_parallel_mode=optimistic;
change master to master_use_gtid=slave_pos;
--source include/start_slave.inc
--echo # Parallel Slave
--connection master
--let $master_server= "master"
--let $domain_1=11
--let $domain_2=12
--let $M_port= $MASTER_MYPORT
--let $S_port= $SLAVE_MYPORT
--let $sync_slave=1
--source include/start_alter_include.inc
--connection master
--source include/save_master_gtid.inc
--connection slave
--source include/sync_with_master_gtid.inc
--echo # cleanup
--source include/stop_slave.inc
--eval set global slave_parallel_threads = $slave_parallel_threads;
--eval set global slave_parallel_mode = $slave_parallel_mode;
--eval set global gtid_strict_mode = $gtid_strict_mode;
set global gtid_domain_id= 0;
--source include/start_slave.inc
--connection master
--eval set global binlog_alter_two_phase=$binlog_alter_two_phase;
set global gtid_domain_id= 0;
--source include/rpl_end.inc