You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Wechar (Jira)" <ji...@apache.org> on 2025/10/09 15:04:00 UTC

[jira] [Commented] (HIVE-28578) Concurrency issue in updateTableColumnStatistics

    [ https://issues.apache.org/jira/browse/HIVE-28578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18028795#comment-18028795 ] 

Wechar commented on HIVE-28578:
-------------------------------

Hi [~dengzh], is this concurrency issue an expected behavior? Similar to that we can not insert rows into *{{TBLS}}* with same db name and table name concurrently.

> Concurrency issue in updateTableColumnStatistics
> ------------------------------------------------
>
>                 Key: HIVE-28578
>                 URL: https://issues.apache.org/jira/browse/HIVE-28578
>             Project: Hive
>          Issue Type: Bug
>          Components: Standalone Metastore
>            Reporter: Zsolt Miskolczi
>            Assignee: Zhihua Deng
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: Repro.java
>
>
> Summary: 
> updateTableColumnStatistics can throw SQLIntegrityConstraintViolationException during replication if HA is on and two different HMS instance gets the same call but with different engine. 
>  
> Workaround: 
> Update table column statistics in single threaded. 
>  
> Details: 
> updateTableColumnStatistics has a relative long running transaction. In that transaction, it validates the actual parameters, queries the metastore db against the TABLE_PARAMS that are already stored and makes a decision based on that. After this, it uses data nucleus to persist the new statistics. 
> From the two HMS instances, one can save the column statistics. And the other cannot as the first instance already saved them. 
>  



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