quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Quarkus version change from 2.10.1.Final to 2.11.1.Final has breaking changes with Percona SqlProxy

Open harpermj66 opened this issue 2 years ago • 26 comments

Describe the bug

Quarkus with hibernate reactive and mysql database configured with a version to 2.11.1 version of quarkus allowed data retrieval from Percona SqlProxy. It worked very well in fact. As of 2.11.1 I'm not able to retrieve data.

Expected behavior

Executing queries writen using hibernate reactive with panache should continue to function as they did in version 2.10.1

Actual behavior

a) on the client Failed to execute statement [select terminalen0_.TERMINAL_ID as terminal1_22_, terminalen0_.COMPANY_ID as company_2_22_, terminalen0_.NAME as name3_22_, terminalen0_.UUID as uuid4_22_ from TERMINAL terminalen0_ where TERMINAL_ID=?]: could not execute query: java.util.concurrent.CompletionException: io.vertx.core.impl.NoStackTraceThrowable: Pending requests failed to be sent due to connection has been closed.

b) on SqlProxy itself

2022-08-19 15:20:29 MySQL_Session.cpp:3364:handler___status_NONE_or_default(): [ERROR] Unexpected packet from client 127.0.0.1 . Session_status: 21 , client_status: 0 Disconnecting it 2022-08-19 15:20:29 MySQL_Session.cpp:149:kill_query_thread(): [WARNING] KILL CONNECTION 1254813 on 10.2.5.21:3306

How to Reproduce?

  1. configure a mysql cluster with a Percona SqlProxy
  2. configure a quarkus test to retrieve data via reactive hibernate panache
  3. use verstion 2.10.1 of quarkus to verify the data is returned.
  4. upgrade to version 2.11.1 and observer the test will error as above.

Output of uname -a or ver

Linux locus-dev01 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.16" 2022-07-19 OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04) OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.11.1

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

Only breaks when going through the percona SqlProxy

harpermj66 avatar Aug 19 '22 15:08 harpermj66

/cc @DavideD, @Sanne, @gavinking

quarkus-bot[bot] avatar Aug 19 '22 21:08 quarkus-bot[bot]

Can you provide a test project reproducing the error? Also, as I have never used Percona SqlProxy, maybe a Docker compose file can help in setting up the environment to reproduce this issue

gastaldi avatar Aug 22 '22 15:08 gastaldi

I would be extremely difficult for me to provide a test project that would have 3 mysql servers in a cluster and another 3 percona sql proxies. The setup of a proxy itself is no walk in the park.

What about taking the what did we change between versions route? I have feeling it may just be a configuration default that we may be able to test reverting.

harpermj66 avatar Aug 22 '22 15:08 harpermj66

We use the Reactive Client drivers from Vert.x - the most likely "change" was a version upgrade in these drivers.

Do you think you could test by overriding the vert.x version for client? Unfortunately the coupling Quarkus/Vert.x is quite high so it might not be possible to get a functioning application with a different driver, but provided you're only changing some micro versions it might work well enough to narrow this problem down.

cc/ @tsegismont

Sanne avatar Aug 22 '22 16:08 Sanne

On 22 Aug 2022, at 17:08, Sanne Grinovero @.***> wrote:

We use the Reactive Client drivers from Vert.x - the most likely "change" was a version upgrade in these drivers.

Do you think you could test by overriding the vert.x version for client? Unfortunately the coupling Quarkus/Vert.x is quite high so it might not be possible to get a functioning application with a different driver, but provided you're only changing some micro versions it might work well enough to narrow this problem down.

cc/ @tsegismont https://github.com/tsegismont — Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1222572054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOWGWXMDJIMNMSMTEFDV2OQXDANCNFSM57BD4YQA. You are receiving this because you authored the thread.

I’ll see if I can do that. What’s the easiest way to do an override the vert.x version? Just in the build file itself?

harpermj66 avatar Aug 22 '22 16:08 harpermj66

In your dependencyManagement section, add the vert.x client version above the import for the Quarkus BOM, so that it takes precedence:

  
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-mysql-client</artifactId>
                <version>something-something</version>
            </dependency>
            <dependency>
            <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

Sanne avatar Aug 22 '22 16:08 Sanne

Sorry I took me some time because we are on Gradle.

implementation("io.vertx:vertx-mysql-client:4.3.0"){ isForce = true } Seems to be the culprit

On 22 Aug 2022, at 17:19, Sanne Grinovero @.***> wrote:

In your dependencyManagement section, add the vert.x client version above the import for the Quarkus BOM, so that it takes precedence:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-mysql-client</artifactId>
            <version>something-something</version>
        </dependency>
        <dependency>
        <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${quarkus.platform.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1222588319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOQEXM3GKCGHPVWN5PDV2OSBNANCNFSM57BD4YQA. You are receiving this because you authored the thread.

harpermj66 avatar Aug 22 '22 16:08 harpermj66

This might be related to pipelining (https://github.com/eclipse-vertx/vertx-sql-client/pull/1168).

I am trying to reproduce atm

tsegismont avatar Aug 23 '22 12:08 tsegismont

I was able to reproduce. I captured network traffic and, indeed, pipelining seems involved:

  • with Quarkus 2.12.2, the client sends execute and close packets immediately after prepare response packet is received
  • with Quarkus 2.10.2, the client waits for response ok packet before sending close packet

tsegismont avatar Aug 23 '22 16:08 tsegismont

Great that you found a reason, haven’t got clue obviously how it can be changed/fixed if it’s broken or sql proxy just can’t cope - Lol

On 23 Aug 2022, at 17:35, Thomas Segismont @.***> wrote:

I was able to reproduce. I captured network traffic and, indeed, pipelining seems involved:

with Quarkus 2.12.2, the client sends execute and close packets immediately after prepare response packet is received with Quarkus 2.10.2, the client waits for response ok packet before sending close packet — Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224319209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOTNZMWMFRSTKFAIQWTV2T4VTANCNFSM57BD4YQA. You are receiving this because you authored the thread.

harpermj66 avatar Aug 23 '22 18:08 harpermj66

I'm trying to figure out a workaround for now. I'll get in touch with MySQL proxy community.

Le mar. 23 août 2022 à 20:01, harpermj66 @.***> a écrit :

Great that you found a reason, haven’t got clue obviously how it can be changed/fixed if it’s broken or sql proxy just can’t cope - Lol

On 23 Aug 2022, at 17:35, Thomas Segismont @.***> wrote:

I was able to reproduce. I captured network traffic and, indeed, pipelining seems involved:

with Quarkus 2.12.2, the client sends execute and close packets immediately after prepare response packet is received with Quarkus 2.10.2, the client waits for response ok packet before sending close packet — Reply to this email directly, view it on GitHub < https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224319209>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKVBAOTNZMWMFRSTKFAIQWTV2T4VTANCNFSM57BD4YQA . You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224489631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALOLNWHBKGBKVXBX2OKZGLV2UGYXANCNFSM57BD4YQA . You are receiving this because you were mentioned.Message ID: @.***>

tsegismont avatar Aug 24 '22 08:08 tsegismont

I reached out to Percona because we have support with them initially. They did say we were their first client to mention reactive hibernate so they were keen to set up a meeting. I can ask my contact at percona to link up with you if necessary.

On 24 Aug 2022, at 09:32, Thomas Segismont @.***> wrote:

I'm trying to figure out a workaround for now. I'll get in touch with MySQL proxy community.

Le mar. 23 août 2022 à 20:01, harpermj66 @.***> a écrit :

Great that you found a reason, haven’t got clue obviously how it can be changed/fixed if it’s broken or sql proxy just can’t cope - Lol

On 23 Aug 2022, at 17:35, Thomas Segismont @.***> wrote:

I was able to reproduce. I captured network traffic and, indeed, pipelining seems involved:

with Quarkus 2.12.2, the client sends execute and close packets immediately after prepare response packet is received with Quarkus 2.10.2, the client waits for response ok packet before sending close packet — Reply to this email directly, view it on GitHub < https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224319209>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKVBAOTNZMWMFRSTKFAIQWTV2T4VTANCNFSM57BD4YQA . You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224489631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALOLNWHBKGBKVXBX2OKZGLV2UGYXANCNFSM57BD4YQA . You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1225374029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOUGDCSQFACH4AV34K3V2XM2FANCNFSM57BD4YQA. You are receiving this because you authored the thread.

harpermj66 avatar Aug 24 '22 08:08 harpermj66

Sure. My address is [github id] at [redhat] dot com.

Le mer. 24 août 2022 à 10:39, harpermj66 @.***> a écrit :

I reached out to Percona because we have support with them initially. They did say we were their first client to mention reactive hibernate so they were keen to set up a meeting. I can ask my contact at percona to link up with you if necessary.

On 24 Aug 2022, at 09:32, Thomas Segismont @.***> wrote:

I'm trying to figure out a workaround for now. I'll get in touch with MySQL proxy community.

Le mar. 23 août 2022 à 20:01, harpermj66 @.***> a écrit :

Great that you found a reason, haven’t got clue obviously how it can be changed/fixed if it’s broken or sql proxy just can’t cope - Lol

On 23 Aug 2022, at 17:35, Thomas Segismont @.***> wrote:

I was able to reproduce. I captured network traffic and, indeed, pipelining seems involved:

with Quarkus 2.12.2, the client sends execute and close packets immediately after prepare response packet is received with Quarkus 2.10.2, the client waits for response ok packet before sending close packet — Reply to this email directly, view it on GitHub <

https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224319209

,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AKVBAOTNZMWMFRSTKFAIQWTV2T4VTANCNFSM57BD4YQA

. You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub < https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1224489631 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AALOLNWHBKGBKVXBX2OKZGLV2UGYXANCNFSM57BD4YQA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1225374029>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AKVBAOUGDCSQFACH4AV34K3V2XM2FANCNFSM57BD4YQA . You are receiving this because you authored the thread.

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1225381309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALOLNTU2ZCCDONFBUHZLULV2XNUHANCNFSM57BD4YQA . You are receiving this because you were mentioned.Message ID: @.***>

tsegismont avatar Aug 24 '22 08:08 tsegismont

Should this be closed as the actual issue is tracked in Vert.x?

geoand avatar Sep 01 '22 07:09 geoand

I believe we can keep it open until the fixed version is integrated in Quarkus.

tsegismont avatar Sep 01 '22 08:09 tsegismont

Okay, no problem

geoand avatar Sep 01 '22 08:09 geoand

Great, this saved me. Thank you. This error gave me no stacktrace even in TRACE level. After trying hours with onFailure just after the query execution, found this issue here just before creating a new one. For anybody trying to use proxysql with the latest 2.12.final version Just downgrade the vertx mysql client as mentioned above. Below version is working.

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-mysql-client</artifactId>
            <version>4.2.7</version>
        </dependency>

rasvi24 avatar Sep 03 '22 10:09 rasvi24

Fixed upstream in https://github.com/eclipse-vertx/vertx-sql-client/pull/1236 (Vert.x 4.3.4)

tsegismont avatar Sep 27 '22 21:09 tsegismont

Thanks for the update @tsegismont.

Just out of curiosity, when is Vert.x 4.3.4 planned?

geoand avatar Sep 28 '22 05:09 geoand

Great, thank you!

On 28 Sep 2022, at 06:05, Georgios Andrianakis @.***> wrote:

Thanks for the update @tsegismont https://github.com/tsegismont.

Just out of curiosity, when is Vert.x 4.3.4 planned?

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1260392364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOQM3VBYAHQGBKN4UVTWAPG2FANCNFSM57BD4YQA. You are receiving this because you authored the thread.

harpermj66 avatar Sep 28 '22 07:09 harpermj66

@geoand very soon, beginning of next week maybe, right @vietj?

@harpermj66 you're welcome. Any news from your contacts at Percona? Are they still willing to talk about this?

tsegismont avatar Sep 28 '22 08:09 tsegismont

Embarressingly not willing to engage for reasons which I don't really go along with. Is there something they should be doing for future proofing?

harpermj66 avatar Oct 06 '22 13:10 harpermj66

No worries, it is fine to not support pipelining. I can think of reasons why ProxySQL doesn't (shared connections).

tsegismont avatar Oct 06 '22 14:10 tsegismont

4.2.7 is a version that works with Quarks 2.11.1 and is the one bundled in 2.10.1 The next one I could find was 4.3.0 which didn’t work with 2.11.1

On 22 Aug 2022, at 17:19, Sanne Grinovero @.***> wrote:

In your dependencyManagement section, add the vert.x client version above the import for the Quarkus BOM, so that it takes precedence:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-mysql-client</artifactId>
            <version>something-something</version>
        </dependency>
        <dependency>
        <groupId>io.quarkus</groupId>
            <artifactId>quarkus-bom</artifactId>
            <version>${quarkus.platform.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>

— Reply to this email directly, view it on GitHub https://github.com/quarkusio/quarkus/issues/27386#issuecomment-1222588319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKVBAOQEXM3GKCGHPVWN5PDV2OSBNANCNFSM57BD4YQA. You are receiving this because you authored the thread.

harpermj66 avatar Oct 11 '22 07:10 harpermj66

This should be fixed in 2.13.1.Final. Can you have a try? Thank you

tsegismont avatar Oct 11 '22 09:10 tsegismont

I don't know where that comment came from 4 hours ago :-) I've already been using 2.13.1.Final and had no issues but we'll do a bit more testing.

harpermj66 avatar Oct 11 '22 11:10 harpermj66

Hi everyone!

We are developing a Quarkus based app (with reactive Panache stack), and we cannot make it work with version 2.13.3.Final (or with any version equals or greater than 2.11.0) with a database that sits behind a SQL proxy. It works perfectly when we connect with a DB without a proxy in the middle, or when we use up to 2.10.4 version. We can override vertx mysql driver to version 4.2.7, but from 2.13.0 that override produces runtime errors.

The error we get when we execute transactions against a DB behind a SQL proxy is:

(vert.x-eventloop-thread-0) Unexpected error: io.smallrye.mutiny.CompositeException: Multiple exceptions caught:
	[Exception 0] io.vertx.core.impl.NoStackTraceThrowable: Fail to read any response from the server, the underlying connection might get lost unexpectedly.
	[Exception 1] io.vertx.core.impl.NoStackTraceThrowable: Connection is not active now, current status: CLOSED

Is there any workaround to this problem?

Thanks!

diegoherrojo avatar Oct 20 '22 13:10 diegoherrojo

@diegoherrojo thanks for reporting.

Can you share a simple reproducer? We have a test upstream which verifies connectivity through ProxySQL, so I'm confused.

Can you verify with mvn dependency:tree if your project uses vertx-mysql-client 4.3.4 ?

tsegismont avatar Oct 24 '22 12:10 tsegismont

Thanks for your quick response @tsegismont!

Yes, I verified that we are using vertx-mysql-client 4.3.4.

Let me create a simple test to share here.

diegoherrojo avatar Oct 24 '22 18:10 diegoherrojo

Hi everyone!

@tsegismont I created a small app reproducing the error with Quarkus 2.13.2.Final.

In order to run it, please unzip test.zip and then execute run.sh. Docker compose, maven and jdk 17 are needed for the test.

The test spins up a MySQL and a ProxySQL and then executes 2 times a POST to the app API (which creates some entities in DB):

  • Once connecting directly to MySQL (successful).
  • Second time connecting through ProxySQL (fails).

Thanks!

diegoherrojo avatar Oct 26 '22 20:10 diegoherrojo