[CONJ-754] Failover connection loop Created: 2020-01-10  Updated: 2020-05-14  Resolved: 2020-05-14

Status: Closed
Project: MariaDB Connector/J
Component/s: galera
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Jukka Siivonen Assignee: Diego Dupin
Resolution: Duplicate Votes: 0
Labels: None
Environment:

MariaDB 10.4
MariaDB JDBC 2.4.4
Galera 4


Issue Links:
Problem/Incident
is caused by CONJ-768 Galera validation galeraAllowedState ... Closed

 Description   

I'm trying to understand failover mechanism and ran into following problem

1) Use JDBC url
jdbc:mariadb://host1,host2:3306/db?galeraAllowedState=4&log=true or
jdbc:mariadb:sequential://host1,host2:3306/db?galeraAllowedState=4&log=true
2) Use MariaDbPoolDataSource and set poolValidMinDelay = 0 so connection is always validated
3) Start application, connections are created in pool for host1
4) For host1 block replication host1>iptables -A OUTPUT -d host2 -j DROP
5) For host1 wsrep_local_state should be soon 0 instead of 4
6) Use application that uses connections to host1. For every connection isValid fails so connections are evicted from pool. But also new connections are created, but again for host1, then validated failing, then evicted and it starts all over again.

What I expected is that connections would be created for host2 which does not happen because isValid is not use in connection creation.

This is what connection evict / create loop looks like in logs

2020-01-09 22:38:39.066 DEBUG 2188 --- [nio-8080-exec-9] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 connection removed from pool due to failed validation (total:0, active:0, pending:1)
2020-01-09 22:38:39.111 DEBUG 2188 --- [ol-1-appender-2] o.m.j.i.protocol.AbstractQueryProtocol   : System variable change :  autocommit = ON
2020-01-09 22:38:39.134 DEBUG 2188 --- [ol-1-appender-2] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 new physical connection created (total:1, active:0, pending:1)
2020-01-09 22:38:39.154 DEBUG 2188 --- [nio-8080-exec-9] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 connection removed from pool due to failed validation (total:0, active:0, pending:1)
2020-01-09 22:38:39.247 DEBUG 2188 --- [ol-1-appender-2] o.m.j.i.protocol.AbstractQueryProtocol   : System variable change :  autocommit = ON
2020-01-09 22:38:39.331 DEBUG 2188 --- [ol-1-appender-2] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 new physical connection created (total:1, active:0, pending:1)
2020-01-09 22:38:39.353 DEBUG 2188 --- [nio-8080-exec-9] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 connection removed from pool due to failed validation (total:0, active:0, pending:1)
2020-01-09 22:38:39.441 DEBUG 2188 --- [ol-1-appender-2] o.m.j.i.protocol.AbstractQueryProtocol   : System variable change :  autocommit = ON
2020-01-09 22:38:39.524 DEBUG 2188 --- [ol-1-appender-2] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 new physical connection created (total:1, active:0, pending:1)
2020-01-09 22:38:39.547 DEBUG 2188 --- [nio-8080-exec-9] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 connection removed from pool due to failed validation (total:0, active:0, pending:1)
2020-01-09 22:38:39.635 DEBUG 2188 --- [ol-1-appender-2] o.m.j.i.protocol.AbstractQueryProtocol   : System variable change :  autocommit = ON
2020-01-09 22:38:39.718 DEBUG 2188 --- [ol-1-appender-2] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 new physical connection created (total:1, active:0, pending:1)
2020-01-09 22:38:39.804 DEBUG 2188 --- [nio-8080-exec-9] o.mariadb.jdbc.internal.util.pool.Pool   : pool MariaDB-pool-1 connection removed from pool due to failed validation (total:0, active:0, pending:1)
2020-01-09 22:38:39.852 DEBUG 2188 --- [ol-1-appender-2] o.m.j.i.protocol.AbstractQueryProtocol   : System variable change :  autocommit = ON



 Comments   
Comment by Jukka Siivonen [ 2020-04-29 ]

Apparently this issue is fixed in https://jira.mariadb.org/browse/CONJ-768. If this issue was motivation for the fix, linking it would be nice.

Comment by Diego Dupin [ 2020-05-14 ]

link to CONJ-760 added, because that solve exactly this issue.

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