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

Compaction Worker thread not freeing the lock when lock status returned as WAITING

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Locking
    • None

    Description

      The following error occurs in the HS2 logs:

       

      (Worker.java:findNextCompactionAndExecute(538)) - Caught an exception in the main loop of compactor worker hiveserver2-0.hiveserver2-service.compute-1648522810-vk7c.svc.cluster.local-62
      org.apache.thrift.TException: Unable to acquire lock(s) on {boa_small_feng.stocks_boa_2019.year=2013}, status {WAITING}, reason {null}
      

      This happens when the compactor thread tries to grab a lock on a table that already has a lock on it.  

      On the HMS side, the lock is saved in the database and queues up the lock.  This queued up lock will block other tables from grabbing the lock even after the original lock is removed.

      When the Worker object on the client side sees this status, it should either unlock immediately if it chooses not to run compaction or keep rechecking the lock.  Currently it does neither. 

      The effect of this is that the lock stays on the table until it times out. This prevents other threads from grabbing the lock.

      The code should probably change to remove the lock immediately.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            scarlin Steve Carlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: