Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-754

Failover connection loop

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • None
    • N/A
    • galera
    • None
    • MariaDB 10.4
      MariaDB JDBC 2.4.4
      Galera 4

    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
      

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              jukkasi Jukka Siivonen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.