Bug #71787 Add info for Waiting for global read lock
Submitted: 21 Feb 2014 10:46 Modified: 26 Feb 2014 16:00
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[21 Feb 2014 10:46] Daniël van Eeden
Description:
http://dev.mysql.com/doc/refman/5.6/en/general-thread-states.html

"Waiting for global read lock

FLUSH TABLES WITH READ LOCK) is waiting for a global read lock."

This is not complete as a 'SET GLOBAL read_only=1' will also

How to repeat:
Run SET GLOBAL read_only=0; and SET GLOBAL read_only=1;

And then:

mysql> SELECT * FROM performance_schema.events_stages_summary_by_thread_by_event_name WHERE EVENT_NAME LIKE 'stage/sql/Waiting for global read lock' AND COUNT_STAR>0;
+-----------+----------------------------------------+------------+----------------+----------------+----------------+----------------+
| THREAD_ID | EVENT_NAME                             | COUNT_STAR | SUM_TIMER_WAIT | MIN_TIMER_WAIT | AVG_TIMER_WAIT | MAX_TIMER_WAIT |
+-----------+----------------------------------------+------------+----------------+----------------+----------------+----------------+
|        31 | stage/sql/Waiting for global read lock |         46 | 45187899279000 |   183754437000 |   982345636000 |  1000184240000 |
+-----------+----------------------------------------+------------+----------------+----------------+----------------+----------------+
1 row in set (0.00 sec)

Suggested fix:
Change from:
"Waiting for global read lock

FLUSH TABLES WITH READ LOCK) is waiting for a global read lock."

To:
"Waiting for global read lock

FLUSH TABLES WITH READ LOCK is waiting for a global read lock or the read_only global variable was being set"

Also note the ")", also for "Waiting for commit lock"
[25 Feb 2014 10:57] MySQL Verification Team
Hello Daniel,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[26 Feb 2014 16:00] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.