[
https://issues.apache.org/jira/browse/HIVE-27201?focusedWorklogId=858534&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-858534
]
ASF GitHub Bot logged work on HIVE-27201:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Apr/23 00:33
Start Date: 22/Apr/23 00:33
Worklog Time Spent: 10m
Work Description: dengzhhu653 commented on code in PR #4180:
URL: https://github.com/apache/hive/pull/4180#discussion_r1174237054
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java:
##########
@@ -5795,7 +5796,7 @@ public synchronized IMetaStoreClient getMSC(
}
throw ex;
}
- String metaStoreUris = conf.getVar(HiveConf.ConfVars.METASTOREURIS);
Review Comment:
Some tests only set `metastore.thrift.uris`, so
`conf.getVar(HiveConf.ConfVars.METASTOREURIS)` is null for this case.
HiveMetaStoreClient checks `metastore.thrift.uris` first, and then
`hive.metastore.uris`:
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java#L212
So we'd better check the `metastore.thrift.uris` first, and then
`hive.metastore.uris` at here.
It's not clear to me why we shouldn't use the `Metastoreconf` in this class,
this class stays in hive-exec, and we have use `Metastoreconf` else where in
the same package.
Issue Time Tracking
-------------------
Worklog Id: (was: 858534)
Time Spent: 3h 50m (was: 3h 40m)
> Inconsistency between session Hive and thread-local Hive may cause HS2
> deadlock
> -------------------------------------------------------------------------------
>
> Key: HIVE-27201
> URL: https://issues.apache.org/jira/browse/HIVE-27201
> Project: Hive
> Issue Type: Bug
> Components: HiveServer2
> Reporter: Zhihua Deng
> Assignee: Zhihua Deng
> Priority: Major
> Labels: pull-request-available
> Time Spent: 3h 50m
> Remaining Estimate: 0h
>
> The HiveServer2’s server handler can switch to process the operation from
> other session, in such case, the Hive cached in ThreadLocal is not the same
> as the Hive in SessionState, and can be referenced by another session.
> If the two handlers swap their sessions to process the DatabaseMetaData
> request, and the HiveMetastoreClientFactory obtains the Hive via Hive.get(),
> then there is a chance that the deadlock can happen.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)