[
https://issues.apache.org/jira/browse/HIVE-17942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16245977#comment-16245977
]
Janaki Lahorani commented on HIVE-17942:
----------------------------------------
Thanks [~akolb] for reviewing this patch.
Based on what I understand about the interactions between HS2 and HMS: for
every end user connection there is a thread in HS2 and an associated thread in
HMS. The configuration changes that are done by the end user in that
connection are supposed to be applicable only to that connection. The
configuration changes in HMS are handled through a thread local variable
(threadLocalConf in HMSHandler).
https://github.com/apache/hive/blob/master/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L273
The first attempt to get configuration from HMS Handler will result in the
initialization of the thread local.
https://github.com/apache/hive/blob/master/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java#L576
HiveAlterHandler when instantiated in HMS will be instantiated as a single
object. IOW, only one object of HiveAlterHandler will be in the JVM and will
be shared amongst all the HMS threads. We need the end user configuration
change to be visible only for that end user connection - the threadLocalConf
exists in HMSHandler for this purpose. So, the bug here is that
HiveAlterHandler is using not using the conf from HMSHandler, and the result is
that the configuration changes are not visible to the end user after a set
command.
> HiveAlterHandler not using conf from HMS Handler
> ------------------------------------------------
>
> Key: HIVE-17942
> URL: https://issues.apache.org/jira/browse/HIVE-17942
> Project: Hive
> Issue Type: Bug
> Affects Versions: 2.1.1
> Reporter: Janaki Lahorani
> Assignee: Janaki Lahorani
> Fix For: 3.0.0
>
> Attachments: HIVE-17942.1.patch, HIVE-17942.2.patch,
> HIVE-17942.3.patch, HIVE-17942.4.patch
>
>
> When HiveAlterHandler looks for conf, it is not getting the one from thread
> local. So, local changes are not visible.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)