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

Option "allowMasterDownConnection" improvement on connection validation and Exceptions on master down

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.5, 1.7.4
    • Component/s: Failover
    • Labels:
      None

      Description

      The current implementation of option "allowMasterDownConnection" permit using the read-only connection when the master connection is down.

      There is 2 limitations :

      • Connection.isValid() that test if connection is valid. Pools make intensive use of that method on connection creation / before borrowing / periodic validation. Differents pools use Connection.setReadOnly(false) before calling Connection.isValid(), to test master connection, even when pool is configure to use by default read only connection. That goes against the expected behaviour of "allowMasterDownConnection" option => then no Connection can be created / borrowed from pool until master is up again
      • any operation on master connection result in throwing a connection exception if master is down.

      Correction proposal :

      • When "allowMasterDownConnection" is enable, Connection.isValid() must return that connection is valid when master is down but read-only connection is valid.
      • any operation on the master connection that doesn't need database operation must not throw an exception if the master is down.
      • any operation on the master connection that required database when master if down must try to reconnect master, succeed or throw the appropriate exception.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: