Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25113

Connection starvation in TxnHandler.getValidWriteIds

    XMLWordPrintableJSON

Details

    Description

       

      The current code looks like below.

      dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
      validTxnList = TxnUtils.createValidReadTxnList(getOpenTxns(), 0);
      

      In the function getOpenTxns, it will request another connection from pool. That is, this thread already held a connection, however, it would request for another connection. When there are more than 10 (default connection pool size) simultaneous getValidWriteIds requests, it can cause a starvation problem. In that situation, each thread holds a connection and waits for another connection. Then, we will see the following exception after timeout.

      metastore.RetryingHMSHandler: MetaException(message:Unable to select from transaction database, java.sql.SQLTransientConnectionException: HikariPool-3 - Connection is not available, request timed out after 30000ms.

       

      Attachments

        Issue Links

          Activity

            People

              hsnusonic Yu-Wen Lai
              hsnusonic Yu-Wen Lai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m