[CONJ-288] Unable to connect to galera non primary node for maintenance Created: 2016-04-25 Updated: 2016-11-23 Resolved: 2016-04-29 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Failover |
| Affects Version/s: | 1.3.6, 1.4.3 |
| Fix Version/s: | 1.4.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Brendon Abbott | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MariaDB galera server 10.0.24 |
||
| Issue Links: |
|
||||||||||||
| Description |
|
If using the JDBC connector as part of a MariaDB/Galera management tool, it is not possible to connect to a non-primary server to query or force it to go primary. This is due to the driver, internally, issuing a select command upon connection, which returns an exception as "data access" is not allowed whilst non primary. Only SHOW and SET are allowed on non primary nodes. This prevents the connection from being returned to the caller.
In 1.2 versions, the driver issued:
|
| Comments |
| Comment by Brendon Abbott [ 2016-04-25 ] | ||||||||||||||||
|
This use case is obviously an edge use case of the connector. Also, I expect that SELECTs are used for a good reason. Would the addition of a url parameter be a useful way around this, so the driver can then not bother with the SELECT? | ||||||||||||||||
| Comment by Diego Dupin [ 2016-04-28 ] | ||||||||||||||||
|
Hi, I will check what is exactly this problem to reuse SHOW VARIABLES. | ||||||||||||||||
| Comment by Diego Dupin [ 2016-04-28 ] | ||||||||||||||||
|
Limits of "SHOW VARIABLES" are 1024 for mysql, mariadb 5.5 and 10.0, 2048 for mariadb 10.1. | ||||||||||||||||
| Comment by Brendon Abbott [ 2016-04-28 ] | ||||||||||||||||
|
Hi - would you like us to test to ensure there are no other issues in this scenario? If so, is there a current master branch build that I can obtain. I have the source, but haven't used maven before. | ||||||||||||||||
| Comment by Brendon Abbott [ 2016-04-28 ] | ||||||||||||||||
|
and thanks for the quick fix by the way! | ||||||||||||||||
| Comment by Diego Dupin [ 2016-04-28 ] | ||||||||||||||||
|
I'm definilty ok to have your confirmation ! Correction is available on maven :
or here is the current snapshot upload : https://oss.sonatype.org/content/repositories/snapshots/org/mariadb/jdbc/mariadb-java-client/1.4.4-SNAPSHOT/ | ||||||||||||||||
| Comment by Brendon Abbott [ 2016-04-28 ] | ||||||||||||||||
|
I managed to get maven working in the end, and built my own. We have tested, and I can confirm the driver now connects to a non-primary galera node. We were then able to promote the node to primary to recover the cluster. | ||||||||||||||||
| Comment by Diego Dupin [ 2016-04-28 ] | ||||||||||||||||
|
Excellent. |