Giter Club home page Giter Club logo

Comments (11)

renecannao avatar renecannao commented on May 26, 2024 1

The fix mentioned in the comments is not in place yet because it is not complete.

from proxysql.

renecannao avatar renecannao commented on May 26, 2024

Is your client using JDBC with auto-reconnect enabled?

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

Is your client using JDBC with auto-reconnect enabled?

Do you mean the client our Users or Services are using to access to Proxysql cluster? if that's the case, I'm not sure, as we have many services from different sources and maybe not all them use the same client config.

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

I talked to developers and they said:

from proxysql.

renecannao avatar renecannao commented on May 26, 2024

Hi @cmejiat104 , the important bit in my previous question is actually "with auto-reconnect enabled?"
I have seen this problem (I will describe it shortly) with several customers using JDBC and auto-reconnect enabled, and it is possible that other libraries have the same problem.
For reference, JDBC auto-reconnect documentation says that the feature is not recommended:
https://dev.mysql.com/doc/connector-j/en/connector-j-connp-props-high-availability-and-clustering.html#cj-conn-prop_autoReconnect

Now, what is the issue that crashed ProxySQL?
The client tries to execute a prepared statement that doesn't exist. ProxySQL currently asserts when this happen (this is your backtrace).
When a client tries to execute a prepared statement that doesn't exist?
We have seen many scenarios in which a client is connected to a proxyql instance, it has a prepared statement prepared, then it lose connectivity with proxysql (for whatever reason), it then reconnects (because of autoReconnect) and tries to execute a prepared statement that doesn't exist anymore: proxysql asserts and crashes.

What happens when you have multiple proxysql instances, and a bugged client with autoReconnect tries to execute a prepared statement that doesn't exist? After crashing the first proxysql, the client will auto-reconnect to the 2nd proxysql instance and try to execute the non-existing prepared statement there too, crashing the 2nd proxysql instance as well.
If you have more proxysql instance, this client will crash them all.

I don't know the exact implementation in the libraries you are using, but if you have autoReconnect (or an equivalent named property) please disable it.

For further reference, auto-reconnect is now deprecated also in MySQL C API:
https://dev.mysql.com/doc/c-api/8.0/en/c-api-auto-reconnect.html

That said, I acknowledge that this must also be considered a serious bug in proxysql, because a buggy application/driver shouldn't lead to a proxysql crash.
We have this in our todo list.

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

Thank you for your replies.

Unfortunately, modifications in Services' client is not possible at this moment, this is a Prod environment.

We have a UAT environment that was also impacted; although, in this case we only have two instances of ProxySQL, proxysql01 and proxysql02, but Mysql backend has three nodes (mysql01, mysql02 and mysql03) as Prod. In the case of UAT, proxysql01 crashed only once and proxysql02 twice, after that both stayed up and running; of course when this happened, for UAT was out of business hours, so only a few batch processes were running, but for Prod was in the middle of peak hours.

During the network issue, connections to & from proxysql02 and mysql02 dropped (between them were fine), in the case of Prod mysql02 was a Mysql Replica and for UAT mysql02 was the Master. BTW, I don't have any query rule configured, so all the transactions go always to the Mysql Master.

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

Might this another issue also related to my Proxysql crashes?

#3371

from proxysql.

renecannao avatar renecannao commented on May 26, 2024

It is the same issue, yes

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

Ok thanks!, but the fix mentioned in the comments is not in place yet, right?

from proxysql.

renecannao avatar renecannao commented on May 26, 2024

This issue is closed by #4481

from proxysql.

cmejiat104 avatar cmejiat104 commented on May 26, 2024

Thank you!

from proxysql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.