-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure database for MySQL doesn't get detected properly #731
Comments
I asked Microsoft for an official way but it didn't get far: https://social.msdn.microsoft.com/Forums/en-US/155e76b4-074c-41fa-8527-972855664966/detect-the-azure-mysql-proxy?forum=AzureDatabaseforMySQL Do you have a support channel with Microsoft where you could raise this issue (while we work on alternatives)? |
It seems that their advice is to use |
Sure, Yes, I've raised this issue through our channels. Waiting for the response 👀 |
FWIW, I like checking the DNS name as a way of detecting the proxy, but as you mentioned, it does take an extra round-trip to detect the actual server version. (And my question to them wasn't about detecting the server version, which is "easy", but about detecting the proxy, in order to know whether the server version should be checked separately.) |
I started working on integration tests for Azure Database for MySQL some time ago (e1d2238) but never merged them into |
I think that's still not optimal, as it will break our prod faster than integration tests as we have more servers :-) Also they update different regions at different pace. Ideally this would require help from Microsoft. We could delete code in ServerSession... |
I've pushed the simplest fix for this issue to address the immediate problem (it can ship soon): 148c5ea But I would like a more robust fix long-term. |
Commented on commit, thanks! |
I don't think I ever made a UserVoice suggestion for identifying the proxy, so I've done that now: https://feedback.azure.com/forums/597982-azure-database-for-mysql/suggestions/38907748-identify-the-azure-database-for-mysql-proxy-in-the |
Fixed in 0.60.3. |
Hi.
Short story: we've got three production incidents on Azure Database for MySQL & MySqlConnector because of this :-(
MySqlConnector/src/MySqlConnector/Core/ServerSession.cs
Line 1315 in f3508e6
Long story:
COM_CHANGE_USER
as a connection reset method in 5.6. In 5.7 things have improved and we havemysql_reset_connection()
method, which is considerably more efficient.MySqlConnector has a way to understand if it's talking to Azure Database for MySQL and issue
select version()
in order to get real version of MySQL. The way it's implemented is prone to error, as it uses hardcoded version number which MySQL presents as only means of getting the version. We use 0.44.1 version of connector which has only "5.6.26.0" hardcoded. I see that "5.6.39.0" has been added after a while, but right now our servers show "5.6.42.0", so even if we used 0.60, the detected version would still be wrong.Because of these things combined, we've got three production incidents after Microsoft updated minor version of MySQL and introduced a slight latency in
COM_CHANGE_USER
. Servers with 5k+ queries per second would have 300+ threads active waiting forChange user
with apps' latencies skyrocketing. We shouldn't see COM_CHANGE_USER at all, as we have MySQL 5.7.I can make a PR adding "5.6.42.0" to this list, but let's make a more robust solution. Every time Microsoft updates their proxy version, we would have downtime. Maybe we could use connection string with something like
ServerVersionOverride=5.7
orForceGetServerVersion=true
.Or we could use DNS names of servers (*.mysql.database.azure.com) instead.
I personally think
ServerVersionOverride=5.7
would better as it's takes roundtrips than getting the server version each time withselect version()
.Related issues:
#288
The text was updated successfully, but these errors were encountered: