You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mysql2 driver, we have the connection entity that manage the connection socket.
In our case, production environment is running with mysql 8 cluster (1 primary and 2 followers) with mysql router that expose single host and port that the driver connect to.
When initiating master failover, 'end' event is emit on the connection socket following 'close' event (which is the expected behaviour)
right after that the connection return 'server close the connection' error and reconnect automatically to mysql router and all following queries are executed as expected and the client recover automaticly.
if we are using connection pool with size of 5 for example, it means we will lose 5 queries during load.
i would like to raise an optimization for critical system that can't lose even 1 query.
We can add a retry mechanism on the connection that when we see this following error we will retry the query ones the connection is back up.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In mysql2 driver, we have the connection entity that manage the connection socket.
In our case, production environment is running with mysql 8 cluster (1 primary and 2 followers) with mysql router that expose single host and port that the driver connect to.
When initiating master failover, 'end' event is emit on the connection socket following 'close' event (which is the expected behaviour)
right after that the connection return 'server close the connection' error and reconnect automatically to mysql router and all following queries are executed as expected and the client recover automaticly.
if we are using connection pool with size of 5 for example, it means we will lose 5 queries during load.
i would like to raise an optimization for critical system that can't lose even 1 query.
We can add a retry mechanism on the connection that when we see this following error we will retry the query ones the connection is back up.
Let me know when you think :)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions