mariadb/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
Andrei Elkin 3616640a31 MDEV-20821 parallel slave server shutdown hang
Parallel slave server shutdown found to be hanging in
close_connections() triggered by shutdown due to a slave worker thread
would not be notified to exit in case the worker was sitting idle.

Fixed with destroying the worker pool earlier that is in
slave_prepare_for_shutdown() when all their driver threads have already left.
A test file is added to simulate the bug condition as well as check
multi-sourced and not-idle worker cases.
2021-05-14 11:49:26 +01:00

79 lines
2 KiB
Text

include/rpl_init.inc [topology=1->3]
connection server_3;
set default_master_connection = '';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
set default_master_connection = 'm2';
change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
include/start_slave.inc
select @@global.slave_parallel_workers as two;
two
2
connection server_3;
SHUTDOWN;
connection server_3;
connection server_3;
connection server_1;
create table t1 (i int primary key) engine=Innodb;
connection server_2;
create table t2 (i int primary key) engine=Innodb;
connection server_3;
set default_master_connection = '';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
set default_master_connection = 'm2';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
connection server_2;
insert into t2 values (1);
connection server_3;
connection server_1;
insert into t1 values (1);
connection server_3;
connection server_3;
SHUTDOWN;
connection server_3;
connection server_3;
connection server_3;
set default_master_connection = '';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
set default_master_connection = 'm2';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
connect conn_block_server3, 127.0.0.1, root,, test, $SERVER_MYPORT_3,;
begin;
insert into t1 values (2);
insert into t2 values (2);
connection server_1;
insert into t1 values (2);
connection server_2;
insert into t2 values (2);
connection server_3;
SHUTDOWN;
connection server_3;
connection server_3;
connection server_3;
set default_master_connection = '';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
set default_master_connection = 'm2';
include/start_slave.inc
Warnings:
Note 1254 Slave is already running
connection server_1;
drop table t1;
connection server_2;
drop table t2;
connection server_3;
set default_master_connection = 'm2';
include/stop_slave.inc
RESET SLAVE ALL;
set default_master_connection = '';
include/rpl_end.inc