[CONJ-491] Crossed Queries and "Packets out of order when reading field packets, expected was EOF stream." Created: 2017-06-01 Updated: 2019-03-13 Resolved: 2019-03-13 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.2.3, 1.5.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Jamie Jackson | Assignee: | Diego Dupin |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Red Hat Enterprise Linux Server release 6.9 (Santiago) |
||
| Issue Links: |
|
||||||||
| Description |
|
I'm getting issues lately with my web app:
These explicit, fatal errors are one of the better types of outcomes during these overall incidents. The most disturbing type of problem that I get is when I don't get an error, but I get crossed queries: Say my app queries, "select a, b, c from mytable", but it ends up with a completely unrelated result (e.g., with columns x, y, and z from some other table), probably from some concurrent connection. At a glance, it looked like a networking issue to me, so I engaged my CIT department to do some troubleshooting on the network, and although they were monitoring during one of the incidents, they saw nothing wrong. There is a section of my application that is slow (due to slow queries), and the problem is almost always precipitated by slow requests to this section; however, we haven't been able to reproduce the issue outside of production. For what it's worth, I've found that the minimum steps to recover from the problem are to:
This problem is beyond my troubleshooting abilities, since it seems to be low-level (i.e., not related to my application code), but rather related to MariaDB (5.5.56), the JDBC driver (1.2.3 & 1.5.9 – I upgraded to try to fix it, but no luck), or my app server (Lucee--an abstraction layer on top of Java). For what it's worth I also filed a ticket with Lucee, but it's languishing: https://luceeserver.atlassian.net/browse/LDEV-1316
|
| Comments |
| Comment by Diego Dupin [ 2017-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Query cache is normally disable by default, but this correspond to an issue detected today : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-12 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yup:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-07-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
closing since it's a server issue : this will be handled with | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks, Diego, but could you try explaining that workaround again? (It's confusing, as written.) Maybe write it as pseudocode with if statements? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-07-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
i've changed
that will disable immediatly the query cache. Server configuration must be changed accordingly (query_cache_type=0) in configuration file, to avoid reenabling it is server is rebooted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-07-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, I forgot that this was about this version of server (5.5). Since this error corresponded perfectly to the I reopen this issue. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, it's suspicious that my symptoms are also packet errors and/or getting results back from unrelated queries. For what it's worth, I disabled the query cache on 7/13 (when I'd thought | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-07-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The thing is that's very weird : error message with "Packet contents (hex) = 03" means that packet content first byte is 03. Before sending column definition packets, server indicate the number of column. This error would indicate that there server send more column than expected. I don't see how that can occur. So i have a few question :
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
For what it's worth, we've been running without query caching since 7/13 (when we'd thought this was caused by * (conn:3425) Packets out of order when reading field packets, expected was EOF stream. Packet contents (hex) = 03 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-18 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I pushed the 2.0.3 driver update & enablePacketDebug=true to production last night. Twenty minutes ago, we suffered another outage due to this bug. Unfortunately, we universally got the "crossed queries" manifestation this time, versus the "EOF" error. When we get crossed queries, we don't get JDBC errors, we just see a slew of downstream effects (e.g., "column not found, `blah`) of the wrong query being returned (because the wrong query's results are returned). Unfortunately, this manifestation doesn't generate its own exception, so I didn't get anything out of the enablePacketDebug=true setting. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jamie Jackson [ 2017-07-25 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As I mentioned previously, I'd been having a mixture of two kinds of problems:
Since upgrading the driver, I only seem to get the first problem, which isn't helpful, since there's no exception now for enablePacketDebug to expose. I need a plan B. Any ideas? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-11-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
closing as requested | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-11-21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
sorry closed wrong task | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2019-03-13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
closing since not reproduced and no news since a long time |