Bug #94150 When "show global status" hang, new connection can't be established
Submitted: 31 Jan 2019 8:47 Modified: 1 Mar 2019 13:38
Reporter: Jia Xu Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.6 5.7 OS:Any
Assigned to: CPU Architecture:Any

[31 Jan 2019 8:47] Jia Xu
When "show global status" hang, new connection can't be established.

When "show global status" hang and holds mutex LOCK_global_system_variables,
THD::init can't lock mutex LOCK_global_system_variables, so new connection can't be established.

How to repeat:
The condition of "show global status" hang is complex, can't repeat.
Set a debug_sync after "show global status" holds LOCK_global_system_variables can repeat this problem.
After "show global status" was hung, new connection can't be established.

How I encounter "show global status" hang :
"show global status" WAIT srv_innodb_monitor_mutex
srv_monitor_thread HOLDS srv_innodb_monitor_mutex WAIT btr_search_latches[i]
"truncate table $name" HOLDS btr_search_s_lock_all WAIT buf_LRU_remove_all_pages: all_freed

And I don't know what buf_LRU_remove_all_pages: all_freed was waiting for.

Suggested fix:
Modify LOCK_global_system_variables from mutex to rwlock.
THD::init and show_status_array use rdlock
[31 Jan 2019 13:52] MySQL Verification Team

When "show global status" hangs, then new connections truly are prevented to establish. In the status, we count number of connections. We can't count them while they are in the flux of closing and creating.

This is expected behaviour. This is intentional by design.

What is a problem that we do not know how to repeat the hang on that command. This can happen only when the load on the server is very, very high. Hence, this bug report can not be repeated if that hang can not be repeated. 

If we can not repeat the behaviour, we can not verify this bug.
[1 Mar 2019 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".