[
https://issues.apache.org/jira/browse/HIVE-18941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16398984#comment-16398984
]
Sergio Peña commented on HIVE-18941:
------------------------------------
[~akolb] and for the person who will work on this issue. There is a logic on
the MetaStoreListenerNotifier.notifyEvent() methods that add a flag to the
listener response parameters that specify whether such listener is executed
inside an active transaction or not. This was very useful for Sentry to detect
if some non-listener calls where indeed called inside a current transaction and
ignore them if they are.
The logic is like this:
{noformat}
if (ms != null) {
event.putParameter(HIVE_METASTORE_TRANSACTION_ACTIVE,
Boolean.toString(ms.isActiveTransaction()));
}
{noformat}
See the code:
[https://github.com/apache/hive/blob/master/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreListenerNotifier.java#L291]
> HMS non-transactional listener may be called in transactional context
> ---------------------------------------------------------------------
>
> Key: HIVE-18941
> URL: https://issues.apache.org/jira/browse/HIVE-18941
> Project: Hive
> Issue Type: Bug
> Components: Metastore
> Affects Versions: 2.0.2, 3.0.0
> Reporter: Alexander Kolbasov
> Priority: Major
>
> When HMS code calls listeners it assumes that they are *not* called as part
> of the transaction. This isn't quite true because of the nested transaction -
> it is quite possible that these listeners are called as part of the bigger
> nested transaction. This causes several potential issues:
> 1) It changes the assumptions about the context in which these listeners run
> 2) It creates possibilities for deadlocks
> 3) Some of these listeners may do relative long operations which may delay
> transaction commits.
> [~spena] FYI.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)