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

The rawStore used in DBTokenStore should be thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Authentication
    • None

    Description

      A non-thread-safe implementation of RawStore, particularly ObjectStore, set in DBTokenStore is being shared by multi-threads, which causes the race condition in DataNuclues to access the backend DB.
      The DN PersistenceManager(PM) in ObjectStore is not thread safe, so DBTokenStore should use a ThreadLocal ObjectStore.
      Following errors might be root caused by the race condition in DN PM.

      Object of type "org.apache.hadoop.hive.metastore.model.MDelegationToken" is detached. Detached objects cannot be used with this operation.
      org.datanucleus.exceptions.ObjectDetachedException: Object of type "org.apache.hadoop.hive.metastore.model.MDelegationToken" is detached. Detached objects cannot be used with this operation.
      at org.datanucleus.ExecutionContextImpl.assertNotDetached(ExecutionContextImpl.java:5728)
      at org.datanucleus.ExecutionContextImpl.retrieveObject(ExecutionContextImpl.java:1859)
      at org.datanucleus.ExecutionContextThreadedImpl.retrieveObject(ExecutionContextThreadedImpl.java:203)
      at org.datanucleus.api.jdo.JDOPersistenceManager.jdoRetrieve(JDOPersistenceManager.java:605)
      at org.datanucleus.api.jdo.JDOPersistenceManager.retrieveAll(JDOPersistenceManager.java:693)
      at org.datanucleus.api.jdo.JDOPersistenceManager.retrieveAll(JDOPersistenceManager.java:713)
      at org.apache.hadoop.hive.metastore.ObjectStore.getAllTokenIdentifiers(ObjectStore.java:6517) 
      

      Attachments

        Issue Links

          Activity

            People

              ctang Chaoyu Tang
              ctang Chaoyu Tang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: