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

HMS may leak db connection when execute exchange partitions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Metastore

    Description

      In your production deployment, the Hive Thrift server is deployed. In the HMSHandler.exchange_partitions method, it executes RawStore.openTransaction and performs some checks. If these checks fail, an exception is thrown without executing commitTransaction or rollbackTransaction. This can result in a leakage of the underlying database connection, as it is not returned to the thread pool. Consequently, all threads may be blocked at the point of obtaining a connection from the connection pool.  

      We should place all operations that come after RawStore.openTransaction inside a try-finally block.

       

      reproduce statement:

      ALTER TABLE dev.yyy EXCHANGE PARTITION (par='') WITH TABLE ods.xxx; 

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zju_zsx zju_zsx
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: