New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-31746 Problems with tx_isolation after MDEV-21921 #2707
Conversation
6eb57b4
to
e5ad780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, keep unrelated changes in a separate commit (ok to have them in the same PR, I know how to look at individual commits within a PR) - for example override changes.
we've discussed that the tracking id can still be one ulonglong. Because the offset is guaranteed to be within sizeof(system_variables) so less than few K (1088 in the current 10.5 and in the current 11.2). And a bit variable is always one bit, so unambiguously represented by a bit number, always less than 64. You can absolutely safely create the tracking id by, say, (bitnum << 32) | offset or (offset << 8) | bitnum
and why did you remove HASH_UNIQUE and replaced it with manual checks for duplicates? I think it'd be much simpler to let hash to enforce the uniqueness.
ack
Tracking id is always passes to the hash function as an address so using another constructed ulonglong seemed excessive, that's why it provides the address of the structure of existing elements.
The bit variable was always constructed as a bitmask of type and not a bitnum.
There wasn't an existing function to transform back to a bitnum that I could see. Providing the address of a structure containing the key of a few bits more that mostly needed to generate the hash was less invasive to achieve.
The |
With session tracking on the tx_isolation of importance to connector frameworks, its important that tracking of tx_isolation does get informed if a user `set session transaction_isolation=X` as the alias for tx_isolation. Rather than just implement this for one variable alias, it is implemented for all aliases. To assist with this the key hash of session_tracker is now made up of the offset, and also a bitmask in the Sys_var_bit class. As these values and their hashs are not unique, the session tracker defination removes its uniqueness on the key. This is to preserve compatibility as previously it was possible to track a variable and its alias so this behaviour is preserved. Rather than previously where the key of the hash was unique, we still need to enforce the uniqueness of the value (m_svar) in the lookup. This is to preserve the behaviour monitoring a duplicate variable silently ignores duplicates. This is implemented in the Session_sysvars_tracker::vars_list::insert. The impacts of aliases are: - If track one variable, its alias changes, you get a tracking change on the variable you are monitoring. - If you track two aliased variables of each other, changing one variable with have two tracking events. - If you are tracking *, you will get a change on the variable changed. If then you change its alias, you'll get two tracking events for both variable changes. Other: * Eliminate session tracking in bootstrap.
e5ad780
to
a78a901
Compare
|
closed via fa2faf4 |
Description
With session tracking on the tx_isolation of importance to connector frameworks, its important that tracking of tx_isolation does get informed if a user
set session transaction_isolation=Xas the alias for tx_isolation.Rather than just implement this for one variable alias, it is implemented for all aliases.
To assist with this the session_tracker has is now made up of the offset types, the sys_var_bit bitmask as well.
This becomes the equivalavant of aliases that change the same memory location.
The impacts of aliases are:
Other:
How can this PR be tested?
test case updated
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
PR quality check