You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "owen park (Jira)" <ji...@apache.org> on 2025/03/28 05:03:00 UTC

[jira] [Created] (HIVE-28851) HiveIcebergMetaHook acquires an HMS lock, regardless of the config and operations

owen park created HIVE-28851:
--------------------------------

             Summary: HiveIcebergMetaHook acquires an HMS lock, regardless of the config and operations
                 Key: HIVE-28851
                 URL: https://issues.apache.org/jira/browse/HIVE-28851
             Project: Hive
          Issue Type: Bug
          Components: Iceberg integration
    Affects Versions: 4.1.0
            Reporter: owen park
            Assignee: owen park


HiveIcebergMetaHook acquires an HMS lock regardless of the config or operation, causing a lock collision.

 

How to reproduce:
{code:java}
set hive.support.concurrency=true;
set hive.txn.ext.locking.enabled=true;
set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
set iceberg.engine.hive.lock-enabled=false;

create table ice_t (i int) stored by iceberg;

insert into ice_t values (1);

2025-03-27T12:54:00,304 INFO [Thread-108] stats.BasicStatsTask: [Warning] could not update stats.Failed with exception Unable to alter table. org.apache.iceberg.hive.LockException: Timed out after 182005 ms waiting for lock on default.ice_t{code}
 
HIVE_LOCKS Table
{code:java}
+----------------+----------------+----------+---------+----------+--------------+---------------+--------------+-----+---------------------+---------------------+| HL_LOCK_EXT_ID | HL_LOCK_INT_ID | HL_TXNID | HL_DB   | HL_TABLE | HL_PARTITION | HL_LOCK_STATE | HL_LOCK_TYPE | ... | HL_BLOCKEDBY_EXT_ID | HL_BLOCKEDBY_INT_ID |+----------------+----------------+----------+---------+----------+--------------+---------------+--------------+-----+---------------------+---------------------+|            110 |              1 |        0 | default | ice_t    | NULL         | a             | w            | ... |                NULL |                NULL ||            111 |              1 |        0 | default | ice_t    | NULL         | w             | x            | ... |                 110 |                   1 |+----------------+----------------+----------+---------+----------+--------------+---------------+--------------+-----+---------------------+---------------------+{code}
 

There is no need for a stats task to take an EXCL_WRITE lock in a HiveIcebergMetaHook.

HiveIcebergMetaHook should be refactored to prevent unnecessary lock acquisitions depending on the config and operation like stats task.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)