mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
93 lines
2.5 KiB
Text
93 lines
2.5 KiB
Text
*** Test STOP SLAVE in parallel mode ***
|
|
include/master-slave.inc
|
|
[connection master]
|
|
connection server_2;
|
|
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
|
|
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
|
|
include/stop_slave.inc
|
|
SET GLOBAL slave_parallel_threads=10;
|
|
SET GLOBAL slave_parallel_mode='conservative';
|
|
CHANGE MASTER TO master_use_gtid=slave_pos;
|
|
include/start_slave.inc
|
|
connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
|
|
connect con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
|
|
connection server_1;
|
|
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
|
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
|
|
CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
|
|
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
|
INSERT INTO t2 VALUES(100);
|
|
INSERT INTO t3 VALUES(100, 100);
|
|
connection server_2;
|
|
include/stop_slave.inc
|
|
connection server_1;
|
|
SET binlog_direct_non_transactional_updates=0;
|
|
SET sql_log_bin=0;
|
|
CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
|
|
SET sql_log_bin=1;
|
|
BEGIN;
|
|
INSERT INTO t2 VALUES (20);
|
|
INSERT INTO t1 VALUES (20);
|
|
INSERT INTO t2 VALUES (21);
|
|
INSERT INTO t3 VALUES (20, 20);
|
|
COMMIT;
|
|
INSERT INTO t3 VALUES(21, 21);
|
|
INSERT INTO t3 VALUES(22, 22);
|
|
connection con_temp1;
|
|
BEGIN;
|
|
INSERT INTO t2 VALUES (21);
|
|
connection server_2;
|
|
START SLAVE IO_THREAD;
|
|
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
|
|
START SLAVE SQL_THREAD;
|
|
connection con_temp2;
|
|
SET @old_dbug= @@GLOBAL.debug_dbug;
|
|
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
|
|
STOP SLAVE;
|
|
connection con_temp1;
|
|
SET debug_sync='now WAIT_FOR wait_for_done_waiting';
|
|
ROLLBACK;
|
|
connection con_temp2;
|
|
SET GLOBAL debug_dbug=@old_dbug;
|
|
SET debug_sync='RESET';
|
|
connection server_2;
|
|
include/wait_for_slave_to_stop.inc
|
|
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
|
a
|
|
20
|
|
SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
|
|
a
|
|
20
|
|
21
|
|
100
|
|
SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
|
|
a b
|
|
20 20
|
|
100 100
|
|
include/start_slave.inc
|
|
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
|
|
a
|
|
20
|
|
SELECT * FROM t2 WHERE a >= 20 ORDER BY a;
|
|
a
|
|
20
|
|
21
|
|
100
|
|
SELECT * FROM t3 WHERE a >= 20 ORDER BY a;
|
|
a b
|
|
20 20
|
|
21 21
|
|
22 22
|
|
100 100
|
|
connection server_2;
|
|
include/stop_slave.inc
|
|
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
|
|
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
|
|
include/start_slave.inc
|
|
SET DEBUG_SYNC= 'RESET';
|
|
disconnect con_temp1;
|
|
disconnect con_temp2;
|
|
connection server_1;
|
|
DROP TABLE t1,t2,t3;
|
|
SET DEBUG_SYNC= 'RESET';
|
|
include/rpl_end.inc
|