hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sushanth Sowmyan (JIRA)" <>
Subject [jira] [Commented] (HIVE-8519) Hive metastore lock wait timeout
Date Tue, 06 Oct 2015 00:11:27 GMT


Sushanth Sowmyan commented on HIVE-8519:

I notice a similar issue when I try to drop a table with about 50000 partitions.

Essentially, what seems to be happening with that flow is the following:

a) Deleting a table requires deleting all partition objects for that table, Table->Partition
is a 1:many mapping
b) Deleting the partition objects requires deleting a all SD objects associated with the partitions,
Partition->SD is a 1:1 mapping
c) Deleting SD objects requires looking for all CDs pointed to by the SDs, and wherever a
CD has no more SDs pointing to it, we need to drop the CD in question, SD->CD is a many:1
d) If a CD is to be deleted, we need to drop all List<MFieldSchema> associated with
it (COLUMNS_V2 where CD_ID in list of CDs to delete.)

The big inefficiency here is that SD->CD is a many:1 mapping with a goal of reusing CDs
for efficiency, but in practice, we don't. But the fact that it is many:1, not 1:1, means
we need to do that additional check before dropping rather than simply dropping. This combination
hits us in the worst way possible for both of those.

We need to rethink the way we use our objects and either drop the many:1 intent or actually
make sure that we create a unique CD for every SD, or this is not going to be scalable. Other
solutions that bypass this wonky model may also exist that we have to work out.

> Hive metastore lock wait timeout
> --------------------------------
>                 Key: HIVE-8519
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: Metastore
>    Affects Versions: 0.10.0
>            Reporter: Liao, Xiaoge
> We got a lot of exception as below when doing a drop table partition, which made hive
query every every slow. For example, it will cost 250s while executing use db_test;
> Log:
> 2014-10-17 04:04:46,873 ERROR Datastore.Persist ( - Update
of object "org.apache.hadoop.hive.metastore.model.MStorageDescriptor@13c9c4b3" using statement
"UPDATE `SDS` SET `CD_ID`=? WHERE `SD_ID`=?" failed : java.sql.SQLException: Lock wait timeout
exceeded; try restarting transaction
>         at com.mysql.jdbc.SQLError.createSQLException(
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(
>         at com.mysql.jdbc.MysqlIO.sendCommand(
>         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(
>         at com.mysql.jdbc.ConnectionImpl.execSQL(
>         at com.mysql.jdbc.PreparedStatement.executeInternal(
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(
>         at com.mysql.jdbc.PreparedStatement.executeUpdate(
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
>         at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(
>         at
>         at
>         at
>         at
>         at
>         at org.datanucleus.state.JDOStateManager.flush(
>         at org.datanucleus.FlushOrdered.execute(
>         at org.datanucleus.ExecutionContextImpl.flushInternal(
>         at org.datanucleus.ExecutionContextThreadedImpl.flushInternal(
>         at
>         at
>         at
>         at org.datanucleus.api.jdo.JDOQuery.execute(
>         at org.apache.hadoop.hive.metastore.ObjectStore.listStorageDescriptorsWithCD(
>         at org.apache.hadoop.hive.metastore.ObjectStore.removeUnusedColumnDescriptor(
>         at org.apache.hadoop.hive.metastore.ObjectStore.preDropStorageDescriptor(
>         at org.apache.hadoop.hive.metastore.ObjectStore.dropPartitionCommon(
>         at org.apache.hadoop.hive.metastore.ObjectStore.dropPartition(
>         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.apache.hadoop.hive.metastore.RetryingRawStore.invoke(
>         at $Proxy4.dropPartition(Unknown Source)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.drop_partition_common(
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.drop_partition(
>         at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>         at java.lang.reflect.Method.invoke(
>         at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(
>         at $Proxy5.drop_partition(Unknown Source)

This message was sent by Atlassian JIRA

View raw message