This is an automated email from the ASF dual-hosted git repository.

dkuzmenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new b4840e5ba91 HIVE-29292: Do not call getMSC from client itself, this 
can lead to deadlock (#6140)
b4840e5ba91 is described below

commit b4840e5ba915dc267233f69d71764c8aa261d254
Author: Denys Kuzmenko <[email protected]>
AuthorDate: Tue Oct 28 09:58:39 2025 +0100

    HIVE-29292: Do not call getMSC from client itself, this can lead to 
deadlock (#6140)
---
 .../apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
 
b/ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
index 8af51d95200..954c9ef152e 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
@@ -101,6 +101,7 @@
 import org.apache.hadoop.hive.metastore.client.utils.HiveMetaStoreClientUtils;
 import org.apache.hadoop.hive.metastore.parser.ExpressionTree;
 import org.apache.hadoop.hive.metastore.partition.spec.PartitionSpecProxy;
+import org.apache.hadoop.hive.metastore.txn.TxnCommonUtils;
 import org.apache.hadoop.hive.metastore.utils.MetaStoreServerUtils;
 import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils;
 import org.apache.hadoop.hive.metastore.utils.SecurityUtils;
@@ -2560,9 +2561,11 @@ private String getValidWriteIdList(String dbName, String 
tblName) {
       final String validWriteIds = 
Hive.get().getConf().get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY);
       final String fullTableName = TableName.getDbTable(dbName, tblName);
 
-      ValidTxnWriteIdList validTxnWriteIdList = (validWriteIds != null) ?
+      final ValidTxnWriteIdList validTxnWriteIdList = (validWriteIds != null) ?
           ValidTxnWriteIdList.fromValue(validWriteIds) :
-          
SessionState.get().getTxnMgr().getValidWriteIds(ImmutableList.of(fullTableName),
 validTxnsList);
+          TxnCommonUtils.createValidTxnWriteIdList(
+              SessionState.get().getTxnMgr().getCurrentTxnId(),
+              getValidWriteIds(ImmutableList.of(fullTableName), 
validTxnsList));
 
       ValidWriteIdList writeIdList = 
validTxnWriteIdList.getTableValidWriteIdList(fullTableName);
       return (writeIdList != null) ? writeIdList.toString() : null;

Reply via email to