[MDEV-31746] Problems with tx_isolation after MDEV-21921 Created: 2023-07-19 Updated: 2023-10-10 Resolved: 2023-08-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Affects Version/s: | 11.1.1 |
| Fix Version/s: | 11.1.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Lawrin Novitsky | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
tx_isolation isn't full alias of tranasaction_isolation - client can't set it and can't track it. It's a bit too radical and/or to fast deprecation to my taste. If we try to set it directly, we don't get an error, we get warning about deprecation, but the value is not changed.
So, the query hasn't really succeeded, but we don't get the error If we attempt to track tx_isolation, the result is even worse - no error, no warning, the value is set, but the variable is not tracked.
We verified that with various connectors, that the variable is not actually tracked. But I think we should consider something more than that up to making it work as before, but with warnings of deprecation. Nobody reads warnings, so maybe something in between would be better - make tracking of tx_isolation work, but leave setting of it not working(it's probably not the blessed way of changing of isolation level anyway). Maybe even make it return error- it makes more sense for me. |
| Comments |
| Comment by Daniel Black [ 2023-07-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@tx_isolation comes through the set variables as a {SHOW_}OPT_DEFAULT rather than a {SHOW_}OPT_SESSION. As such this won't end up in the session tracker (same code in 10.4 as 11.1). Are connectors relying on this behaviour? If they are using @@session.tx_isolation they should be fine. Testing session tracking next.... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-07-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So two session tracking can exist session_track_transaction_info=STATE will track transaction info (as does the higher CHARACTERISTICS. The session tracking here is in sql/sys_vars.inl +2412 hasn't materially changes since implemented On variables. I pulled up wireshark and looked at protocol for:
(which is probably the same as before)
However didn't result in a session change while monitoring tx_isolation. Should it? Should it be the case that monitoring all deprecated variables where a new variable names generates and event? And vis-verse? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-07-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So no regression, @@tx_isolation isn't tracked, only @@session.tx_isolation. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-07-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
odd behaviour in @@tx_isolation - MDEV-31751 has been there for a while. As connectors need to track a user pushing SET SESSION transaction_isolation=X while monitoring tx_isolation, resolving with a fast tracked alias implementation like | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-07-27 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Review comments given last week.
Did change just now:
note on availability. I'm starting a flight soon to present at conference at weekend and will be on leave without communications immediately afterwards. Please make any additional changes without me. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2023-08-03 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks. I've simplified the fix but kept your test case. Basically I removed the support for Sys_var_bit aliases as we don't have them, so cannot test the new code anyway. One point of controversy less. And removed that logic where if you track both aliases, you get two tracking events after modifying one variable — it would be more backward compatible to get only one event if one variable is modified. This made for a rather simple implementation at the end of the day. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2023-10-10 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||