[
https://issues.apache.org/jira/browse/HIVE-23318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17095546#comment-17095546
]
Jesus Camacho Rodriguez commented on HIVE-23318:
------------------------------------------------
[~rajesh.balamohan], [~ashutoshc], there are two places where we call this.
- One is periodically to find any dangling locks through the materializations
rebuild lock cleaner task. That one can be disabled by removing the class
{{org.apache.hadoop.hive.metastore.MaterializationsRebuildLockCleanerTask}}
from {{metastore.task.threads.remote}}.
- The other one is at commit transaction time. That one is probably the one you
are seeing here repeatedly, since it is executed for each transaction. The
problem is that {{commitTxn}} does not have any information about whether the
table for which you are committing is a materialized view or not.
The right way to fix this would probably be changing the thrift
{{CommitTxnRequest}} to include a new optional field ({{isMaterialization}}?)
which should be set to true when the request is created for materialized view
rebuild; otherwise you would have to retrieve the table from the RDBMS to check
it, which would defeat the purpose of the fix.
That would help all queries independently on whether the feature is used or
not. Disabling it via toggle seems risky because any HS2 that accidentally uses
the feature can create this locks and leave them dangling.
> TxnHandler need not delete from MATERIALIZATION_REBUILD_LOCKS on need basis
> ---------------------------------------------------------------------------
>
> Key: HIVE-23318
> URL: https://issues.apache.org/jira/browse/HIVE-23318
> Project: Hive
> Issue Type: Improvement
> Components: Hive
> Reporter: Rajesh Balamohan
> Priority: Minor
>
> Observed the following queries when materialized view or any of its feature
> was not used.
> TxnHandler need not clear this part of txn commit. It would help in reducing
> the sql parsing time in server side as well.
> {noformat}
> G....delete from MATERIALIZATION_REBUILD_LOCKS where mrl_txn_id = 120398082
> G....delete from MATERIALIZATION_REBUILD_LOCKS where mrl_txn_id = 120398084
> G....delete from MATERIALIZATION_REBUILD_LOCKS where mrl_txn_id = 120398112
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)