Bug #115524 key_object_cache_mutex and key_object_loading_cond are not registered
Submitted: 5 Jul 2024 10:13 Modified: 17 Jul 2024 5:44
Reporter: Huaxiong Song (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version:8.0.38, 9.0.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[5 Jul 2024 10:13] Huaxiong Song
Description:
From the code, we can find key_object_cache_mutex and key_object_loading_cond are not registered.

When stuck in a wait relationship, performance.events_waits* may show incorrect
'EVENT_NAME'.

In fact, there is a TODO item for initializing them.

This is a small suggestion.

How to repeat:
Simply, the problem can be seen from the code

Suggested fix:
Add them to the corresponding array to be initialized.
[5 Jul 2024 10:15] Huaxiong Song
Patch to fix this bug

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug#115524.patch (application/octet-stream, text), 3.37 KiB.

[5 Jul 2024 11:57] MySQL Verification Team
Hello Huaxiong Song,

Thank you for the report and contribution.

regards,
Umesh
[17 Jul 2024 5:44] Huaxiong Song
Sorry, there is a problem with my previous fix...
The pfs of the DD(cond and mutex) cannot be added directly as I said before, which will cause memory problems.
I may know why TODO was recorded in the DD-related PFS at that time, because Shared_dictionary_cache is a static singleton object, and its destruction time is later than cleanup_instruments, which will cause memory problems.

My solution is to modify the implementation of the singleton and explicitly control the life cycle of Shared_dictionary_cache.
[17 Jul 2024 5:45] Huaxiong Song
Bug fix of 115524

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug#115524_new.patch (application/octet-stream, text), 4.91 KiB.

[18 Jul 2024 8:48] Huaxiong Song
Bug fix of 115524

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug#115524_new.patch (application/octet-stream, text), 5.25 KiB.