[
https://issues.apache.org/jira/browse/HIVE-29496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Venugopal Reddy K updated HIVE-29496:
-------------------------------------
Summary: Materialized view rebuild fails with "SemanticException: Another
process is rebuilding the materialized view mydb.ice_mv1" OR
"SemanticException: Exception acquiring lock for rebuilding the materialized
view" when source is an iceberg table (was: when source is an iceberg table,
materialized view rebuild failed with "SemanticException: Another process is
rebuilding the materialized view mydb.ice_mv1" OR "SemanticException: Exception
acquiring lock for rebuilding the materialized view" )
> Materialized view rebuild fails with "SemanticException: Another process is
> rebuilding the materialized view mydb.ice_mv1" OR "SemanticException:
> Exception acquiring lock for rebuilding the materialized view" when source is
> an iceberg table
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-29496
> URL: https://issues.apache.org/jira/browse/HIVE-29496
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Reporter: Venugopal Reddy K
> Priority: Major
>
> *[Description]*
> when source is an iceberg table, materialized view rebuild succeeds for the
> first time. But subsequent materialized view rebuild fail with one of these
> exceptions.
> "SemanticException org.apache.hadoop.hive.ql.parse.SemanticException: Another
> process is rebuilding the materialized view mydb.ice_mv1;" +when rebuild is
> tried with same materialized view as first succeeded one.+
> *OR*
> "SemanticException org.apache.hadoop.hive.ql.parse.SemanticException:
> Exception acquiring lock for rebuilding the materialized view;" +when rebuild
> is tried with different materialized view.+
> Happens because lock is acquired with txn id as 0 and not released after
> rebuild. And MRL_TXN_ID is PRIMARY KEY for MATERIALIZATION_REBUILD_LOCKS
> table.
> ||MATERIALIZATION_REBUILD_LOCKS||
> ||MRL_TXN_ID||MRL_DB_NAME||MRL_TBL_NAME||MRL_LAST_HEARTBEAT||
> |{color:#FF0000}0{color}|mydb|ice_mv1|1,773,117,466,400|
>
> *[Steps to reproduce]*
> # Create an iceberg table, insert some data to it.
> # Create a materialized view(either in Hive ACID or Iceberg format) with
> source as above created iceberg table.
> # Insert some data into iceberg table again so that mv becomes outdated for
> rewriting.
> # Alter materialized view rebuild so that it can be used in rewriting.
> # Repeat step-3 and step-4 again. This time materialized view rebuild throws
> *Error: Error while compiling statement: FAILED: SemanticException
> org.apache.hadoop.hive.ql.parse.SemanticException: Another process is
> rebuilding the materialized view mydb.ice_mv1;*
> # Here after, none of the other materialized views(created with any iceberg
> source table) rebuild works. All of them fail with below exception. Can
> verify with below steps.
> ## Try creating another iceberg table, insert some data and another
> materialized view.
> ## Insert some more data to the iceberg table and rebuild the mv created on
> step-6. Materialized view Rebuild throws - {*}Error: Error while compiling
> statement: FAILED: SemanticException
> org.apache.hadoop.hive.ql.parse.SemanticException: Exception acquiring lock
> for rebuilding the materialized view;{*}{*}{*}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)