Skip to content
/ server Public

MDEV-39008 FederatedX: set time_zone on connection change#4791

Open
PeterKoletzki wants to merge 7 commits intoMariaDB:10.11from
PeterKoletzki:bb-10.11-MDEV-39008-federatedx-timestamp-timezone
Open

MDEV-39008 FederatedX: set time_zone on connection change#4791
PeterKoletzki wants to merge 7 commits intoMariaDB:10.11from
PeterKoletzki:bb-10.11-MDEV-39008-federatedx-timestamp-timezone

Conversation

@PeterKoletzki
Copy link

@PeterKoletzki PeterKoletzki commented Mar 12, 2026

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.

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
@CLAassistant
Copy link

CLAassistant commented Mar 12, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ PeterKoletzki
❌ PeterSecusmart
You have signed the CLA already but the status is still pending? Let us recheck it.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 12, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. open a federatedX conneciton
  2. restart the remote server
  3. try a query that requires a timezone
  4. try another query that requires a timezone
  5. 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.

@PeterKoletzki
Copy link
Author

I have added the test and made the change to use a boolean flag.
You are right, it looks cleaner.

Sorry. But I have no idea what mysql.cc does.
So it is better that I do not change anything that I do not understand. or have no knowledge

PeterSecusmart and others added 4 commits March 16, 2026 10:38
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
@PeterKoletzki
Copy link
Author

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.

@PeterKoletzki
Copy link
Author

PeterKoletzki commented Mar 17, 2026

Cursor AI make some comments after my request to analyse this isuue:

MDEV-39008: With timezone_after_reconnect (reconnect path, backend restart),
server shutdown reports "Warning: Memory not freed: N" (e.g. 9304). PR without
this test had no such warning. FederatedX fix itself allocates nothing; leak
likely in libmariadb reconnect path or server cleanup. Suppression added so CI
passes. Maintainers may remove this and fix the leak, or keep/refine the pm.

I have added a adjusted suite.pm by Cursor. We will see ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

4 participants