Bug #72561 Add P_S metrics on GET_LOCK() usage
| Submitted: | 7 May 2014 18:14 | Modified: | 23 Oct 2015 9:44 |
|---|---|---|---|
| Reporter: | Simon Mudd | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Performance Schema | Severity: | S4 (Feature request) |
| Version: | 5.7 | OS: | Any |
| Assigned to: | Marc ALFF | CPU Architecture: | Any |
| Tags: | GET_LOCK, locking, performance_schema | ||
[7 May 2014 18:14]
Simon Mudd
[23 Oct 2015 9:43]
Marc ALFF
This feature is now implemented in MySQL 5.7 GET_LOCK uses metadata locks with an OBJECT_TYPE of USER LEVEL LOCK See http://dev.mysql.com/doc/refman/5.7/en/metadata-locks-table.html for details, the table performance_schema.metadata_locks displays who owns / who waits user level locks.
[23 Oct 2015 9:54]
Mark Leith
Note, you need to enable the metadata lock instrument:
UPDATE setup_instruments
SET ENABLED = 'YES'
WHERE NAME = 'wait/lock/metadata/sql/mdl';
Then it's pretty easy to see current locks, including those that are pending, with:
mysql> select object_name, lock_status, owner_thread_id from metadata_locks where object_type = 'user level lock';
+---------------+-------------+-----------------+
| object_name | lock_status | owner_thread_id |
+---------------+-------------+-----------------+
| somelock | GRANTED | 23 |
| someotherlock | GRANTED | 23 |
| somelock | PENDING | 24 |
+---------------+-------------+-----------------+
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.