polardbxengine/mysql-test/suite/rpl_nogtid/t/rpl_semi_sync_deadlock.test

120 lines
2.5 KiB
Plaintext

################################################################################
# WL#6969 Additional concurrency tests for BGC
#
# Concurrency test verifies that there is not 3-way deadlock any more.
#
# ################################################################################
--source include/not_group_replication_plugin.inc
--source include/have_debug_sync.inc
--source include/master-slave.inc
--source include/install_semisync.inc
--echo # Initialization
SET @debug_save= @@GLOBAL.DEBUG;
SET GLOBAL rpl_semi_sync_master_timeout= 6000000;
--echo #
--echo # Verify no deadlock at AFTER_SYNC
--echo #
--source extra/rpl_tests/rpl_semi_sync_deadlock.test
--echo #
--echo # Verify no deadlock at AFTER_COMMIT
--echo #
SET GLOBAL rpl_semi_sync_master_wait_point= AFTER_COMMIT;
--source extra/rpl_tests/rpl_semi_sync_deadlock.test
--echo # Cleanup
SET GLOBAL rpl_semi_sync_master_timeout= 600000;
--disable_query_log
--disable_result_log
--let $n= 11
--let $i= 1
while ($i < $n)
{
--eval CREATE TABLE t$i(c1 INT) ENGINE= InnoDB;
--inc $i
}
--enable_result_log
--enable_query_log
--source include/sync_slave_sql_with_master.inc
--connection master
SET GLOBAL debug= 'd,semi_sync_3-way_deadlock';
SET DEBUG_SYNC= "before_process_commit_stage_queue WAIT_FOR signal.rotate_finished";
--echo # Build 10 connections to master server
--disable_query_log
--disable_result_log
--let $i= 1
while ($i < $n)
{
--connect(con$i,127.0.0.1,root,,test,$MASTER_MYPORT,)
--inc $i
}
--enable_result_log
--enable_query_log
--echo # Execute INSERT statement on these 10 connections in parallel
--disable_query_log
--disable_result_log
--let $i= 1
while ($i < $n)
{
--connection con$i
--send
--eval INSERT INTO t$i VALUES(2)
--inc $i
}
--enable_result_log
--enable_query_log
--connection master1
SET DEBUG_SYNC= "before_rotate_binlog SIGNAL signal.rotate_finished";
--real_sleep 3
--echo # Rotate binlog file
FLUSH LOGS;
--disable_query_log
--disable_result_log
--let $i= 1
while ($i < $n)
{
--connection con$i
--reap
--inc $i
}
--enable_result_log
--enable_query_log
# clean up
--connection master
--disable_query_log
--disable_result_log
# disconnect connections
--let $i= 1
while ($i < $n)
{
--disconnect con$i
--inc $i
}
# drop tables
--let $i= 1
while ($i < $n)
{
--eval DROP TABLE t$i
--inc $i
}
--enable_result_log
--enable_query_log
SET DEBUG_SYNC= 'RESET';
SET @@GLOBAL.DEBUG= @debug_save;
SET GLOBAL rpl_semi_sync_master_wait_point= AFTER_SYNC;
--source include/sync_slave_sql_with_master.inc
--source include/uninstall_semisync.inc
--source include/rpl_end.inc