File: binlog_set_trans_dependency_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 (90 lines) | stat: -rw-r--r-- 2,254 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
# ==== Purpose ====
#
# Test verifies that there is no deadlock when following commands are executed
# in parallel.
#
# SHOW BINARY LOGS
#
# SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE
# 'binlog_transaction_dependency_tracking'
#
# PURGE BINARY LOGS BEFORE $date;
#
# ==== Implementation ====
#
# With the help of DEBUG_SYNC operations simulate the deadlock environment.
#
# 1) PURGE LOGS BEFORE date
#    Owns: MYSQL_BIN_LOG::LOCK_index
#    Waits for: THD::LOCK_thd_data
#
# 2) select query on performance_schema.session_variables table
#    Owns: THD::LOCK_thd_data
#    Waits for: MYSQL_BIN_LOG::LOCK_log
#
# 3) SHOW BINARY LOGS
#    Owns: MYSQL_BIN_LOG::LOCK_log
#    Waits for: MYSQL_BIN_LOG::LOCK_index
#
# ==== References ====
#
# Bug#28511326: DEADLOCK DURING PURGE_LOGS_BEFORE_DATE

--source include/have_debug_sync.inc
--source include/have_log_bin.inc

--echo #
--echo # Bug 92108: Deadlock by concurrent SHOW BINLOGS,
--echo # performance_schema.session_variables query, and binlog purge
--echo #

RESET MASTER;
FLUSH LOGS;
--enable_connect_log
--connect(con1,localhost,root,,)

SET DEBUG_SYNC="purge_logs_after_lock_index_before_thread_count SIGNAL purge_ready WAIT_FOR finish_purge";

--send PURGE BINARY LOGS BEFORE '2038-01-19'

--connect(con2,localhost,root,,)

SET DEBUG_SYNC="materialize_session_variable_array_THD_locked SIGNAL pfs_ready WAIT_FOR finish_pfs";

--send SELECT * FROM performance_schema.session_variables WHERE VARIABLE_NAME LIKE 'binlog_transaction_dependency_tracking';

--connect(con3,localhost,root,,)

SET DEBUG_SYNC="show_binlogs_after_lock_log_before_lock_index SIGNAL show_ready WAIT_FOR finish_show";

--send SHOW BINARY LOGS

--connection default

SET DEBUG_SYNC="now WAIT_FOR purge_ready";
SET DEBUG_SYNC="now WAIT_FOR pfs_ready";
SET DEBUG_SYNC="now WAIT_FOR show_ready";

SET DEBUG_SYNC="now SIGNAL finish_purge";
SET DEBUG_SYNC="now SIGNAL finish_pfs";
SET DEBUG_SYNC="now SIGNAL finish_show";

--connection con1
replace_regex /\.[\\\/]binlog/binlog/;
reap;
--disconnect con1

--connection con2
reap;
--disconnect con2

--connection con3
--disable_result_log
reap;
--enable_result_log
--disconnect con3

--connection default

SET DEBUG_SYNC= 'RESET';
--disable_connect_log