[CONJ-477] Aurora not compatible with option usePipelineAuth Created: 2017-05-23  Updated: 2017-06-04  Resolved: 2017-06-04

Status: Closed
Project: MariaDB Connector/J
Component/s: aurora
Affects Version/s: 2.0.0-RC, 1.6.0, 2.0.1
Fix Version/s: 1.6.1, 2.0.2

Type: Bug Priority: Major
Reporter: Xing Du Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to CONJ-474 Aurora sqltransientconnectionexceptio... Closed

 Description   

Environment:

HikariCP version: 2.6.1
JDK version : 1.8.0_125
Database : MySQL
Driver :org.mariadb.jdbc.Driver
Driver version : 2.0.1

Issue:
Running into a weird issue while using HikariCP with mariadb connector. HikariCP pool stuck at start up sequence after I changed com.mysql.jdbc.Driver to org.mariadb.jdbc.Driver

Usage:
String driver = "org.mariadb.jdbc.Driver";
String jdbcUrl = "jdbc:mysql://mysql_host:3306";
Class.forName(driver);
HikariConfig config = new HikariConfig();
config.setDriverClassName(driver);
config.setJdbcUrl(jdbcUrl);
config.setUsername(user);
config.setPassword(password);
config.setConnectionTimeout(30000);
config.setMaximumPoolSize(20);
config.setAutoCommit(false);
config.addDataSourceProperty("cachePrepStmts", true);
config.addDataSourceProperty("prepStmtCacheSize", 250);
config.addDataSourceProperty("prepStmtCacheSqlLimit", 2048);
datasource = new HikariDataSource(config);

The application stuck at the line:
datasource = new HikariDataSource(config);

Got this log while I'm using "com.mysql.jdbc.Driver":
thread="main" log="INFO" class="c.z.h.HikariDataSource" HikariPool-5 - Starting...
thread="main" log="INFO" class="c.z.h.HikariDataSource" HikariPool-5 - Start completed.

But after switching to mariadb connector, this is the last line I see:
thread="main" log="INFO" class="c.z.h.HikariDataSource" HikariPool-5 - Starting...

Note: I've tested with multiple mysql servers as well as an Aurora one. Regardless of which one is used as jdbc URL, HikariDataSource fails starting as long as I use mariadb driver.

Temporary Solution:
I've done testing by downgrading mariadb driver to version 1.5.4 and this solved the connection hanging problem.
With more testing I found out the latest version that can work well with Aurora is 1.5.9

After going through the change log for 1.6.0 / 2.0.0-RC, I found out the culprit: usePipelineAuth is default to true.

  • Either downgrade to version 1.5.9 or below
  • Or continue using 1.6.0 / 2.0.0 / 2.0.1 and mark usePipelineAuth=false in the jdbc url.


 Comments   
Comment by Xing Du [ 2017-05-24 ]

Hi MariaDB JDBC driver developer(s)

It seems the "usePipelineAuth" introduced in 2.0.0 is incompatible with AWS Aurora cluster / instances.
Can you please get this addresses? I'd like to continue using the latest version of your awesome driver.

If you need more details for debugging this issue, please let me know and I'd be happy to help providing more details.

Comment by Diego Dupin [ 2017-06-04 ]

Aurora detection has been added to prevent use of 2 options that have inconsistent issue : useBatchMultiSend and usePipelineAuth.
at the same time, discussion will be initiate with the aurora team so this could be solved on aurora level.

Generated at Thu Feb 08 03:15:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.