MDEV-39008 FederatedX: set time_zone on connection change#4791
MDEV-39008 FederatedX: set time_zone on connection change#4791PeterKoletzki wants to merge 7 commits intoMariaDB:10.11from
Conversation
When the underlying connection to the remote server changes (e.g. load balancer switching nodes or driver reconnect), the session variable time_zone was not set again. TIMESTAMP values could then be wrong. Track the connection (mysql.net.vio) and re-send SET time_zone='+00:00' when the vio changes so TIMESTAMP remains consistent. Made-with: Cursor
|
|
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
I'd love if you would consider adding a regression test for this. It can be as simple as:
- open a federatedX conneciton
- restart the remote server
- try a query that requires a timezone
- try another query that requires a timezone
- cleanup
A slightly more advanced version would be to add a DBUG_EXECUTE_IF() with a unique key name, that, when set, will disconnect the federatedX session before the next query. And then do as the above, but instead of restarting the remote just set the flag on the federatedX server.
…, and federatedx_io_mysql.cc
|
I have added the test and made the change to use a boolean flag. Sorry. But I have no idea what mysql.cc does. |
When the underlying connection to the remote server changes (e.g. load balancer switching nodes or driver reconnect), the session variable time_zone was not set again. TIMESTAMP values could then be wrong. Track the connection (mysql.net.vio) and re-send SET time_zone='+00:00' when the vio changes so TIMESTAMP remains consistent. Made-with: Cursor
…, and federatedx_io_mysql.cc
…it@github.com:PeterKoletzki/server.git
|
federated.timezone_after_reconnect 'X' w13 [ pass ] 1444 The log supposed that there is a memory leak after the test sequence related to client.cc. I have not a idea whats going on, because my test passed and my company refused me to spend more time in this testing things. |
|
Cursor AI make some comments after my request to analyse this isuue: MDEV-39008: With timezone_after_reconnect (reconnect path, backend restart), I have added a adjusted suite.pm by Cursor. We will see ... |
When the underlying connection to the remote server changes (e.g. load balancer switching nodes or driver reconnect), the session variable time_zone was not set again. TIMESTAMP values could then be wrong.
Track the connection (mysql.net.vio) and re-send SET time_zone='+00:00' when the vio changes so TIMESTAMP remains consistent.