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

Unable to connect to galera non primary node for maintenance

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.3.6, 1.4.3
    • 1.4.4
    • Failover
    • None
    • MariaDB galera server 10.0.24

    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.

      org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.loadServerData()
       
      LineNumber:  596
      executeQuery(qr, "SELECT "
                          + "@@max_allowed_packet, "
                          + "@@system_time_zone, "
                          + "@@time_zone, "
                          + "@@sql_mode", ResultSet.TYPE_FORWARD_ONLY);
      

      In 1.2 versions, the driver issued:

      org.mariadb.jdbc.internal.mysql.MySQLProtocol.connect(String, int)
       
      LineNumber:  392
      qr = (SelectQueryResult) executeQuery(new MySQLQuery("show variables like 'max_allowed_packet'"));
      

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              brendon Brendon Abbott
              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.