You are correct that DbTxnManager does not support the explicit locking of tables. Instead it obtains locks based on SQL statements that are being executed.

If you use the DummyTxnManager (the default) and set concurrency to true and the lock manager to ZooKeeperHiveLockManager then your locks should go away when the process dies (ZooKeeper handles this for you). Obviously you have to have a ZooKeeper service set up to use this.

Alan.

Shushant Arora <mailto:shushantaror...@gmail.com>
November 16, 2015 at 10:47
Hi

I have a doubt on hive locking mechanism.
I have 0.13 deployed on my cluster.
When I create explicit lock using
lock table tablename partition(partitionname) exclusive. It acquires lock as expected.

I have a requirement to release the lock if hive connection with process who created the lock dies .How to achieve this? In current situation lock is released only explicitly by calling unlcok table tbalenme partition(). Requirement is to handle the process which acquires a lock and gets killed because of any reason before calling unlock.

While using TxnMgr org.apache.hadoop.hive.ql.lockmgr.DbTxnManager for handling transaction timeout it did n't allow explicit locking and threw below exception

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Current transaction manager does not support explicit lock requests. Transaction manager: org.apache.hadoop.hive.ql.lockmgr.DbTxnManager

Reply via email to