You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/09/24 17:59:59 UTC

[GitHub] [iceberg] szehon-ho commented on issue #2301: Lock remains in HMS if HiveTableOperations gets killed (direct process shutdown - no signals) after lock is acquired

szehon-ho commented on issue #2301:
URL: https://github.com/apache/iceberg/issues/2301#issuecomment-926820596


   I found it useful to have a small script to unlock manually as well (in case the HMS thread is not configured).  In scala for instance assuming you get a hmsclient:
   
   ```
    def unlock(db: String, table: String): Unit = {
       val lockIds = getLockIds(db, table)
       lockIds.foreach{
         hmsClient.unlock(_)
       }
     }
   
     private def getLockIds(db: String, table: String): Set[Long] = {
       val showLockRequest = new ShowLocksRequest()
       showLockRequest.setDbname(db)
       showLockRequest.setTablename(table)
       showLockRequest.setIsExtended(true)
       val response = hmsClient.showLocks(showLockRequest)
       val locks = response.getLocks.asScala
       locks.map(_.getLockid).toSet
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org