hive: Error in acquiring locks

created at 06-02-2022 views: 7

error

ERROR : FAILED: Error in acquiring locks: Locks on the underlying objects cannot be acquired. retry after some time
org.apache.hadoop.hive.ql.lockmgr.LockException: Locks on the underlying objects cannot be acquired. retry after some time

solution

set hive.support.concurrency=false;

reason

There are two lock modes defined in Hive:

  • Shared lock(S)
  • Exclusive lock (X)

As the name implies, multiple shared locks (S) can be acquired at the same time, but an exclusive lock (X) blocks all other locks.

If you select a table, this table will enter the shared mode, operations such as adding, inserting, deleting, modifying data, and modifying the table name will be executed after the shared lock is released, and will keep waiting.

If you insert, delete, or modify data, you will enter the Exclusive lock mode. After entering the exclusive lock mode, addition, deletion, and modification operations are not allowed, and an error will be reported.

ERROR : FAILED: Error in acquiring locks: Locks on the underlying objects cannot be acquired. retry after some time org.apache.hadoop.hive.ql.lockmgr.LockException: Locks on the underlying objects cannot be acquired. retry after some time

Release the Exclusive lock mode to operate.

created at:06-02-2022
edited at: 06-02-2022: