File: rpl_semi_sync_deadlock.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (119 lines) | stat: -rw-r--r-- 2,599 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
################################################################################
# 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_source_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_source_wait_point= AFTER_COMMIT;
--source extra/rpl_tests/rpl_semi_sync_deadlock.test

--echo # Cleanup
SET GLOBAL rpl_semi_sync_source_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";
--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_source_wait_point= AFTER_SYNC;
--source include/sync_slave_sql_with_master.inc

--source include/uninstall_semisync.inc
--source include/rpl_end.inc