ProxySQL 2.7 - Connections returned to pool lose init_connect settings

20 views
Skip to first unread message

Dave Rix

unread,
Jun 20, 2025, 1:51:10 PMJun 20
to proxysql
Hi,
We are testing ProxySQL in front of a multi-region Aurora Global cluster, and are currently have great success, apart from a strange issue we are experiencing at the moment in the secondary region with connections that are returned to the ProxySQL pool.

Due to the nature of the application, we are reluctant to make app changes at the moment, so are using the Aurora `init_connect` parameter to set the session variable `aurora_replica_read_consistency` when the connections are made to the db.

This works great for new connections, or connections that are opened and stay open, however I believe that when a connection is returned to the pool the session settings are lost. I have tried to verify this with a simple bash script that just checks the session variables every few seconds so that it uses a connection from the pool.

When I summarise the results I get the following - repeated throughout the day

      1 2025-06-20,16:00,
      5 2025-06-20,16:00,SESSION
      5 2025-06-20,16:01,SESSION
      2 2025-06-20,16:02,
      4 2025-06-20,16:02,SESSION
      1 2025-06-20,16:03,
      5 2025-06-20,16:03,SESSION
      6 2025-06-20,16:04,SESSION
      6 2025-06-20,16:05,SESSION
      2 2025-06-20,16:06,
      4 2025-06-20,16:06,SESSION
      6 2025-06-20,16:07,SESSION
      3 2025-06-20,16:08,
      3 2025-06-20,16:08,SESSION

I changed the ProxySQL variable `mysql-connection_max_age_ms` to "1", so that connections are dropped when complete instead of being returned to the pool and the errors have stopped.

Can you tell me if the session is "reset" when a connection is returned to the pool, which confirms my suspicions, and if so, is there any way that we can configure ProxySQL to reset the session to a "known state" which can include certain settings such as the `aurora_replica_read_consistency` setting?

I have set the config parameter `mysql-connection_max_age_ms` back to a longer value, and am waiting to see the errors return, which I do suspect, but it might take a while as they do not immediately occur.

Thanks in advance for any advice!
Regards,
Dave



René Cannaò

unread,
Jun 20, 2025, 2:41:14 PMJun 20
to Dave Rix, proxysql
Hi Dave,

Thank you for your post.

What you describe seems like a bug, but to be confirmed.

Can you please report an issue on github.com , together with steps to reproduce it, configuration, and full error log?

Thanks 

--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/proxysql/f26dd3a4-bd11-43bb-895d-5089cd7b1ea6n%40googlegroups.com.

Dave Rix

unread,
Jun 20, 2025, 3:05:09 PMJun 20
to proxysql
Thanks for getting back to me so quickly!
Yes, I will do that.
I hope to be able to test against v3 early next week, but I may have to hand the issue over to a colleague.

Thanks for such a great product!
Regards,
Dave
Reply all
Reply to author
Forward
0 new messages