Open
Conversation
Contributor
|
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 |
We have 16 bits and we have enums till 15 (0 to 15) even after increment. So if I leave MDL_BIT unchanged (do not subtract 1), it will work as bit masking is supported and in the range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes MDEV-39184
Problem:
MDL constants values of 0 assign some default values (MDL_INTENTION_EXCLUSIVE, BACKUP) before MDL_REQUEST_INIT(). That does not make sense if MDL_REQUEST_INIT() was not called. Please rework the values of 0 into (MDL_NOT_INITIALIZED, NOT_INITIALIZED). Described by these comments in the code:
Fix
1- Increment all values in enum_mdl_type by 1.
2- Add a 0 at the start of the incompatibility arrays so the enum indices continue to match their corresponding bitmasks.
3- Update the MDL_BIT macro from (1U << A) to (1U << ((A) - 1)) to account for the enum shift.
This ensures that uninitialized MDL constants are correctly handled while preserving existing bitmask mappings.