You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug #30215068 BINLOG ROTATION DEADLOCK WHEN INNODB CONCURRENCY LIMIT SETTED
PROBLEM
-------
1. In SBR, replication related mutexes are acquired while rotating a binlog. These
mutexes are released only after updating a gtid table.
2. Before the rotate thread can commit ,many update transactions which
are not updating any rows are fired which enter innodb and
increase the srv_conc.n_active connection. Since no rows are
updated it will not call MYSQL_BIN_LOG::prepare() which would
have decremnted the srv_conc.n_active. These update threads later
wait on the replication mutexes held by the rotate thread.
3. Since the innodb_thread_concurrency is set to very low value
the rotate thread cannot enter innodb since innodb_thread_concurrency
has been reached ,so there is a deadlock
4. This issue is not seen in RBR.
FIX
---
1. Consider rotate thread as a special thread which updates the gtid implicitly and
and skip innodb thread concurrency check for it. The fix is backport
from Bug #30427369.
2. Patch even skips threads having active attacable transactions. Even these
can result in deadlock in low innodb_thread_concurrency setting.
This fix is a backport of Bug#3109077.
Reviewed by : Praveenkumar Hulakund <praveenkumar.hulakund@oracle.com>
Reviewed by : Debarun Banerjee <debarun.banerjee@oracle.com>
SET DEBUG_SYNC = 'stop_binlog_rotation_after_acquiring_lock_log SIGNAL rotate_stopped WAIT_FOR proceed_rotate';
18
+
--send INSERT INTO t1 VALUES (1);
19
+
20
+
# Since innodb_thread_concurrency=1, Send txn from a different connection
21
+
22
+
--connect (con2, localhost, root,,)
23
+
SET DEBUG_SYNC= 'now WAIT_FOR rotate_stopped';
24
+
--SEND UPDATE t2 SET C2=1 WHERE C1 = 1;
25
+
26
+
--connect (con3, localhost, root,,)
27
+
# Verify that con1 is waiting in stop_binlog_rotation_after_acquiring_lock_log sync point and con 2 is waiting for con1 to commit
28
+
--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'debug sync point: stop_binlog_rotation_after_acquiring_lock_log' and info = 'INSERT INTO t1 VALUES (1)'
29
+
--source include/wait_condition.inc
30
+
--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'query end' and info = 'UPDATE t2 SET C2=1 WHERE C1 = 1'
31
+
--source include/wait_condition.inc
32
+
33
+
# Continue rotate thread (con1)
34
+
SET DEBUG_SYNC= 'now SIGNAL proceed_rotate';
35
+
36
+
--connection con1
37
+
#without fix con1 will hang because it cannot get innodb concurrency ticket
0 commit comments