File: innodb_thread_concurrency_debug.result

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 (101 lines) | stat: -rw-r--r-- 3,231 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
# Setup connections
SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency;
SET @old_innodb_concurrency_tickets := @@innodb_concurrency_tickets;
SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay;
#
# Bug #19386426	SHUTDOWN HANGS: CLIENT THREAD IN A LOOP
# AROUND SRV_CONC_ENTER_INNODB()
#
SET GLOBAL innodb_thread_concurrency = 1;
create table t1(f1 int) engine=innodb;
SET DEBUG_SYNC= 'ib_after_row_insert
SIGNAL opened WAIT_FOR flushed';
insert into t1 values(12);
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'user_thread_waiting
SIGNAL flushed WAIT_FOR opened1';
insert into t1 values(13);
set global innodb_thread_concurrency=0;
SET DEBUG_SYNC= 'now SIGNAL opened1';
select * from t1;
f1
12
13
drop table t1;
#
# bug#23476050 THREADS STUCK WAITING TO ENTER INNODB
#
# Scenario-1: High Priority Transaction
In connection DEFAULT
SET GLOBAL innodb_thread_concurrency = 1;
CREATE TABLE t1(col1 INT PRIMARY KEY);
INSERT INTO t1 VALUES(10);
START TRANSACTION;
# Lock Row
UPDATE t1 SET col1 = 20 where col1 = 10;
# stop after TrxInInnoDB and before innodb thread concurrency
SET DEBUG_SYNC= 'ha_innobase_index_read_begin SIGNAL kill_me WAIT_FOR proceed';
UPDATE t1 SET col1 = 30 where col1 = 20;
In connection CON-1
SET DEBUG_SYNC='now WAIT_FOR kill_me';
include/start_transaction_high_prio.inc
START TRANSACTION /* HIGH PRIORITY */;
SET DEBUG_SYNC= 'trx_kill_blocking_enter SIGNAL proceed';
UPDATE t1 SET col1 = 100;
COMMIT;
In connection DEFAULT
# Rolled back by high priority transaction
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT * FROM t1;
col1
100
DROP TABLE t1;
# Scenario-2: Auto Increment in partitioned table
SET GLOBAL innodb_thread_concurrency = 1;
CREATE TABLE t1 (col1 INT AUTO_INCREMENT PRIMARY KEY, col2 int)
PARTITION BY KEY(col1) PARTITIONS 2;
INSERT INTO t1(col2) VALUES(10);
SELECT * FROM t1;
col1	col2
1	10
# stop after innodb thread concurrency before auto increment lock
SET DEBUG_SYNC='ib_after_row_insert SIGNAL got_innodb_ticket WAIT_FOR proceed';
INSERT INTO t1(col2) VALUES (20);
In connection CON-1
SET LOCAL binlog_format = 'STATEMENT';
Warnings:
Warning	1287	'@@binlog_format' is deprecated and will be removed in a future release.
SET DEBUG_SYNC='now WAIT_FOR got_innodb_ticket';
INSERT INTO t1(col2) SELECT 30;
In connection CON-2
SET DEBUG_SYNC='now SIGNAL proceed';
In connection CON-1
In connection DEFAULT
SELECT * FROM t1 ORDER BY col1;
col1	col2
1	10
2	20
3	30
DROP TABLE t1;
#
# bug#27661171 INNODB: TRX->DECLARED_TO_BE_INSIDE_INNODB
#
CREATE TABLE t1 (col1 INT AUTO_INCREMENT PRIMARY KEY, col2 int)
PARTITION BY KEY(col1) PARTITIONS 2;
# Insert 2 rows in same statement consuming the tickets
SET GLOBAL innodb_concurrency_tickets = 2;
SHOW VARIABLES LIKE 'innodb_concurrency_tickets';
Variable_name	Value
innodb_concurrency_tickets	2
INSERT INTO t1(col2) VALUES (10), (20);
SELECT * FROM t1 ORDER BY col1;
col1	col2
1	10
2	20
DROP TABLE t1;
# Cleanup
SET DEBUG_SYNC='reset';
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
SET GLOBAL innodb_concurrency_tickets = @old_innodb_concurrency_tickets;
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;