Bug #121982 LOCK_partial_revokes missing from Performance Schema mutex instruments

Submitted: 29 Nov 16:49
Reporter: QiFan Liu Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:26.10.0 OS:Linux
Assigned to: CPU Architecture:x86
Tags: mutex, partial_revokes, performance schema, PSI

[29 Nov 16:49] QiFan Liu
Description:
With Performance Schema enabled, setup_instruments contains the neighboring SQL mutex instruments LOCK_authentication_policy and LOCK_global_conn_mem_limit, but contains no instrument for LOCK_partial_revokes.

The observed output is:

result
FAIL
NAME	ENABLED	TIMED
wait/synch/mutex/sql/LOCK_authentication_policy	NO	NO
wait/synch/mutex/sql/LOCK_global_conn_mem_limit	NO	NO

include/mysql/components/services/bits/psi_mutex_bits.h states: "To instrument a mutex, a mutex key must be obtained using register_mutex. Using a zero key always disable the instrumentation."

LOCK_partial_revokes is initialized with key_LOCK_partial_revokes, so its instrument should be registered and exposed in performance_schema.setup_instruments.

Bug #36809659 also involves unregistered PSI keys, but concerns different synchronization primitives.

How to repeat:
Start the server with --performance-schema=ON and run the following as root:

SELECT
  CASE
    WHEN @@performance_schema = 1
     AND (SELECT COUNT(*)
            FROM performance_schema.setup_instruments
           WHERE NAME LIKE 'wait/synch/mutex/sql/%partial_revokes%') = 1
     AND (SELECT COUNT(*)
            FROM performance_schema.setup_instruments
           WHERE NAME IN (
             'wait/synch/mutex/sql/LOCK_authentication_policy',
             'wait/synch/mutex/sql/LOCK_global_conn_mem_limit')) = 2
    THEN 'PASS'
    ELSE 'FAIL'
  END AS result;

SELECT NAME, ENABLED, TIMED
  FROM performance_schema.setup_instruments
 WHERE NAME IN (
   'wait/synch/mutex/sql/LOCK_partial_revokes',
   'wait/synch/mutex/sql/LOCK_authentication_policy',
   'wait/synch/mutex/sql/LOCK_global_conn_mem_limit')
 ORDER BY NAME;

Suggested fix:
Register key_LOCK_partial_revokes with the server mutex PSI instruments before LOCK_partial_revokes is initialized.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 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.