98 lines
2.9 KiB
Plaintext
98 lines
2.9 KiB
Plaintext
################################################################################
|
|
# This test case checks if MTS allows to concurrently access the replication
|
|
# tables, and as such, concurrently commit transactions that update different
|
|
# databases.
|
|
#
|
|
# It does so by making the workers' threads to sleep after updating replication
|
|
# tables but before releasing locks and committing the current transaction.
|
|
################################################################################
|
|
|
|
#--source include/not_gtid_enabled.inc
|
|
#--source include/not_group_replication_plugin.inc
|
|
--source include/have_debug_new.inc
|
|
#--source include/have_innodb.inc
|
|
# no format specific tests so we run it only in MIXED mode
|
|
--source include/have_binlog_format_row.inc
|
|
#--let $rpl_skip_reset_master_and_slave= 1
|
|
#--source include/master-slave.inc
|
|
--source include/paxos.inc
|
|
|
|
# connect 3 server. must have test database
|
|
--connect (conn1,127.0.0.1,root,,test,$MYPORT_1)
|
|
--connect (conn2,127.0.0.1,root,,test,$MYPORT_2)
|
|
--connect (conn3,127.0.0.1,root,,test,$MYPORT_3)
|
|
--connect (conn4,127.0.0.1,root,,test,$MYPORT_1)
|
|
|
|
|
|
--connection conn1
|
|
CREATE DATABASE db_1;
|
|
|
|
CREATE TABLE db_1.test_1 (id INTEGER) engine=Innodb;
|
|
CREATE TABLE db_1.test_2 (id INTEGER) engine=Innodb;
|
|
|
|
#--connection master
|
|
--source include/wait_follower_catchup.inc
|
|
|
|
--connection conn2
|
|
#--source include/stop_slave.inc
|
|
stop xpaxos_replication;
|
|
#set @save.slave_parallel_workers= @@global.slave_parallel_workers;
|
|
set @save.debug= @@global.debug;
|
|
show variables like 'slave_parallel_workers';
|
|
#SET @@global.slave_parallel_workers= 2;
|
|
#ALTER TABLE mysql.slave_relay_log_info ENGINE= Innodb;
|
|
#ALTER TABLE mysql.slave_worker_info ENGINE= Innodb;
|
|
#--source include/start_slave.inc
|
|
start xpaxos_replication;
|
|
|
|
--connection conn1
|
|
|
|
# Create two slave side parallelizable transactions.
|
|
# Logical_Clock requires one more which is the first
|
|
# one in binlog as a warmup.
|
|
INSERT INTO db_1.test_1 VALUES(0);
|
|
#--source include/sync_slave_sql_with_master.inc
|
|
--source include/wait_follower_catchup.inc
|
|
|
|
SET GLOBAL debug="d,mts_debug_concurrent_access";
|
|
|
|
--connection conn1
|
|
BEGIN;
|
|
INSERT INTO db_1.test_1 VALUES(1);
|
|
--connection conn4
|
|
BEGIN;
|
|
INSERT INTO db_1.test_2 VALUES(1);
|
|
--connection conn1
|
|
COMMIT;
|
|
--connection conn4
|
|
COMMIT;
|
|
|
|
--connection conn1
|
|
drop table db_1.test_1;
|
|
#--source include/sync_slave_sql_with_master.inc
|
|
--source include/wait_follower_catchup.inc
|
|
|
|
--connection conn1
|
|
drop table db_1.test_2;
|
|
#--source include/sync_slave_sql_with_master.inc
|
|
--source include/wait_follower_catchup.inc
|
|
|
|
--connection conn1
|
|
|
|
DROP DATABASE db_1;
|
|
#--source include/sync_slave_sql_with_master.inc
|
|
--source include/wait_follower_catchup.inc
|
|
|
|
# --source include/stop_slave.inc
|
|
# SET @@global.slave_parallel_workers= @save.slave_parallel_workers;
|
|
# SET @@global.debug= @save.debug;
|
|
# --source include/start_slave.inc
|
|
|
|
#
|
|
# clean up
|
|
#
|
|
SET @@global.debug= "";
|
|
#set @@global.slave_parallel_workers= @save.slave_parallel_workers;
|
|
|
|
#--source include/rpl_end.inc
|