implydata / plyql

MySQL-like queries for Druid built on top of Plywood

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mysql gateway - connection getting closed

rajitha703 opened this issue · comments

Hi,

I am facing two issues with the Mysql gateway :

The following query was fired twice from the mysql console :

mysql> select count(*) from supply where "2016-06-23 01:00:00" <= __time AND __time < "2016-06-23 02:00:00" group by countryId limit 10;
Query OK, 0 rows affected, 25971 warnings (0.10 sec)

mysql> select count() from supply where "2016-06-23 01:00:00" <= __time AND __time < "2016-06-23 02:00:00" group by countryId limit 10;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 21
Current database: *
* NONE ***

Query OK, 0 rows affected, 25971 warnings (0.40 sec)


Issue 1. Notice that the first time , query runs fine but the second time, it says the Mysql server has gone away.
Following are the log lines on the Mysql server of Plyql. Both times I get the same error logged
Got SQL: select count(*) from supply where "2016-06-23 01:00:00" <= __time AND __time < "2016-06-23 02:00:00" group by countryId limit 10
Got SQL: SELECT DATABASE()
Error: Connection lost: The server closed the connection.

Issue 2 : The same query I tried to run directly using PLYQL as follows :
rajitha.r:~$ plyql -h mybroker:8082 -q 'select count(*) from supply where "2016-06-23 01:00:00" <= __time AND __time < "2016-06-23 02:00:00" group by countryId limit 10'
And this runs absolutely fine and gives the correct output. This is a bit strange as the Mysql gateway should also have returned the same output but doesn't.

I am using a latest version of Plyql. Can someone please help me on this.

I haven't seen this with PlyQL but I have seen similar errors when there is a misconfiguration of the MySQL timeout and connection pooling on the client. If MySQL is timing out a connection that is maintained in a pool then when it is assigned you would see this error. Don't know if that is helpful in this case. Good luck!

Please note that this project is now deprecated. Please see the Druid SQL docs for information on using SQL syntax with Druid.