You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Denys Kuzmenko (Jira)" <ji...@apache.org> on 2025/04/06 17:52:00 UTC
[jira] [Commented] (HIVE-28851) HiveIcebergMetaHook acquires an HMS lock, regardless of the config and operations
[ https://issues.apache.org/jira/browse/HIVE-28851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941400#comment-17941400 ]
Denys Kuzmenko commented on HIVE-28851:
---------------------------------------
Merged to master
Thanks for the fix, [~owenpark]!
> 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
> Priority: Major
> Labels: pull-request-available
>
> HiveIcebergMetaHook acquires an HMS lock regardless of the config or operation, causing a lock collision.
> As a consequence, stat tasks fail during insert queries.
>
> 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 hive.stats.autogather=true;
> create table ice_t (i int) stored by iceberg tblproperties ('engine.hive.lock-enabled'='false');
> 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_DB | HL_TABLE | HL_LOCK_STATE | HL_LOCK_TYPE | ... | HL_BLOCKEDBY_EXT_ID |
> +----------------+---------+----------+---------------+--------------+-----+---------------------+
> | 110 | default | ice_t | a | w | ... | NULL |
> | 111 | default | ice_t | w | x | ... | 110 |
> +----------------+---------+----------+---------------+--------------+-----+---------------------+{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)