Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13836

DbNotifications giving an error = Invalid state. Transaction has already started

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 2.1.1, 2.2.0
    • None

    Description

      I used pyhs2 python client to create tables/partitions in hive. I was working fine until I moved to multithreaded scripts which created 8 connections and ran DDL queries concurrently.
      I got the error as

      2016-05-04 17:49:26,226 ERROR org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-4-thread-194]: HMSHandler Fatal error: Invalid state. Transaction has already started
      org.datanucleus.transaction.NucleusTransactionException: Invalid state. Transaction has already started
              at org.datanucleus.transaction.TransactionManager.begin(TransactionManager.java:47)
              at org.datanucleus.TransactionImpl.begin(TransactionImpl.java:131)
              at org.datanucleus.api.jdo.JDOTransaction.internalBegin(JDOTransaction.java:88)
              at org.datanucleus.api.jdo.JDOTransaction.begin(JDOTransaction.java:80)
              at org.apache.hadoop.hive.metastore.ObjectStore.openTransaction(ObjectStore.java:463)
              at org.apache.hadoop.hive.metastore.ObjectStore.addNotificationEvent(ObjectStore.java:7522)
              at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:114)
              at com.sun.proxy.$Proxy10.addNotificationEvent(Unknown Source)
              at org.apache.hive.hcatalog.listener.DbNotificationListener.enqueue(DbNotificationListener.java:261)
              at org.apache.hive.hcatalog.listener.DbNotificationListener.onCreateTable(DbNotificationListener.java:123)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_core(HiveMetaStore.java:1483)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.create_table_with_environment_context(HiveMetaStore.java:1502)
              at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:138)
              at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:99)
              at com.sun.proxy.$Proxy14.create_table_with_environment_context(Unknown Source)
              at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$create_table_with_environment_context.getResult(ThriftHiveMetastore.java:9267)
      

      Attachments

        1. HIVE-13836.2.patch
          2 kB
          Nachiket Vaidya
        2. HIVE-13836.2-branch-2.1.patch
          2 kB
          Barna Zsombor Klara
        3. HIVE-13836.patch
          2 kB
          Nachiket Vaidya

        Issue Links

          Activity

            People

              vaidyand Nachiket Vaidya
              vaidyand Nachiket Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: