Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#60682: deadlock from thd_security_context
The problem is a circular wait condition when providing information about the internal state of InnoDB. When printing information about active transactions, InnoDB holds the kernel mutex (so that transactions do not disappear) and calls back into the server to get a description (in particular, the query) of every session that is associated with a transaction. Since these sessions might be executing unrelated statements, a per-session lock is taken so that the query string can be safely copied. This lock order poses a problem because there might be cases, specially when processing a KILL statement, where the per- session lock is acquired before attempting to acquire locks that might also be acquired by InnoDB while holding the kernel mutex. In order to avoid this problematic lock order, the query of a session associated with an active transaction is no longer displayed in the output of SHOW ENGINE INNODB STATUS. There query now is only printed if a session is describing itself (that is, if the session to be described belongs to the calling thread).
- Loading branch information