[CONJ-397] Query run by connector/j hungs in 'sending data' status Created: 2016-12-05 Updated: 2017-11-21 Resolved: 2017-11-21 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.5.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Ostap Demkovych | Assignee: | Diego Dupin |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Environment: |
mariadb 10.1.19 |
||
| Attachments: |
|
| Description |
|
I am experiencing issue which crops up as long running query (25s). When I copy that query to heidysql it finishes within 300ms. Additionally the issue could depend on some DB server statistic because it is reproduced when I run it with filtering by 11/27/16 date. Probably some periods when there are more data are more likely to reproduce the bug. |
| Comments |
| Comment by Diego Dupin [ 2016-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Could you indicate the exact option used in connection string and indicate if maxscale is used ? | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
MaxScale isn't used. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
That's stange, because setting useServerPrepStmts to false will execute the query like in heidysql. The only change would be the escaping done on parameters. Can you send the values of server SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; and the query ? | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, very strange issue. And I am sure it is the mariadb connector/j issue because mysql connectorj works fine. SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE
| |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-12-14 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Reading code, i don't see any issue. if you use SLF4j, have you the possibility to run this query with parameter log=true and set org.mariadb.jdbc logging level to trace ? or having a wireshark dump ? that's the only way to identify the issue. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
I've run trace logging and will attach two txt files with results. Meanwhile I was running log I've discovered one minor issue: org.mariadb.jdbc.internal.logging.LoggerFactory#init method isn't threadsafe. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-12-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
It seems data send to server are alright, it must not be driver related, but server perform badly on this particular request using binary protocol compare to text protocol. If you have the possibility to test that, using MySQL connector with option "useServerPrepStmts" to true must be as slow. searching why | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
I will try mysql connector. Also, how to explain that mariadb connector doesn't react to useServerPrepStmts=false and heidysql executes the query. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-12-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
I cannot understand why useServerPrepStmts=false would have the issue. For a single query, there is very few differences with rewriteBatchedStatements=true that cannot explain that kind of problems. I'll check tomorrow but I remember having see a server issue that make a full table scan on second execution of a prepare statement on certain condition. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
I've checked one more time useServerPrepStmts=false in mariadb connectorj and it works. I must did some mistake when tried it at first time. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ostap Demkovych [ 2016-12-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Should I reenter this issue as related to mariadb? | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2016-12-22 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
That would be better. | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-11-21 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Closing since not reproduced. |