Conversation
|
Hi @pranavktiwari, Thank you for the patch! Now I see that change for MDL_BIT has negative effect on performance which is unwanted. I'd better tell in the description that it is investigation task and should be evaluated for push. Nonetheless, if we rework It seems that I cannot recognize the changes for the second part of the ticket (about |
There was a problem hiding this comment.
Pull request overview
This PR reworks MDL enum constant values so that 0 represents an uninitialized MDL state (instead of mapping to real lock types), and updates related mappings/output so metadata lock reporting continues to work.
Changes:
- Shifted
enum_mdl_type/ backup-stage lock constants soMDL_NOT_INITIALIZEDbecomes0. - Introduced
MDL_key::NOT_INITIALIZED=0namespace and updated handlers/mappings accordingly. - Updated incompatibility matrices, metadata-lock name tables, and adjusted mysql-test expected results.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sql/sp.h | Adds handling for MDL_key::NOT_INITIALIZED in namespace→handler switch. |
| sql/mdl.h | Updates MDL type and namespace enums and shifts backup lock constants. |
| sql/mdl.cc | Adds NOT_INITIALIZED PSI stage entry, pads name tables, and pads incompatibility arrays. |
| plugin/metadata_lock_info/metadata_lock_info.cc | Adds “Not initialised” entry to namespace name table. |
| mysql-test/main/mdl_sync.result | Updates expected output ordering for MDL metadata_lock_info. |
| mysql-test/main/mdl.result | Updates expected output ordering for MDL metadata_lock_info. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
eea7448 to
7bca7c5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| PSI_stage_info MDL_key::m_namespace_to_wait_state_name[NAMESPACE_END]= | ||
| { | ||
| {0, "Not initialised", 0}, | ||
| {0, "Waiting for backup lock", 0}, |
There was a problem hiding this comment.
MDL_key::enum_mdl_namespace now has NOT_INITIALIZED (index 0) and a corresponding PSI stage entry was added. However, wsrep_get_mdl_namespace_name() (later in this file) does not handle MDL_key::NOT_INITIALIZED, so wsrep debug output will report the namespace as "UNKNOWN" for this new value. Add an explicit case for NOT_INITIALIZED to keep diagnostics accurate (and to avoid -Wswitch-enum warnings if enabled).
Added --sorted_result to the MDL tests to ensure deterministic ordering of metadata_lock_info output. Since MDL lock iteration order depends on hash_value() and underlying Split-Ordered List behavior, it may vary with internal changes such as enum value shifts.
8f814d3 to
316d078
Compare
| TODO (newbie): should be MDL_NOT_INITIALIZED= 0, as it is strange | ||
| that not-inited request has MDL_INTENTION_EXCLUSIVE. | ||
| Must fix tests, as at least mysql_rm_table_no_locks() depends on this. | ||
| */ |
There was a problem hiding this comment.
This comment should be removed too.
fixes MDEV-39184
Problem:
MDL tests results ordering is not deterministic.
Fix
Added --sorted_result to the MDL tests to ensure deterministic ordering of metadata_lock_info output. Since MDL lock iteration order depends on hash_value() and underlying Split-Ordered List behavior, it may vary with
internal changes such as enum value shifts.