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

MaterializationsInvalidationCache loading causes race condition in the metastore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • None

    Description

      I am seeing occasional failures running metastore tests where operations are failing saying that there is no open transaction.  I have traced this to a race condition in loading the materialized view invalidation cache.  When it is initialized (either in HiveMetaStoreClient in embedded mode or in HiveMetaStore in remote mode) it grabs a copy of the current RawStore instance and then loads the cache in a separate thread.  But ObjectStore keeps state regarding JDO transactions with the underlying RDBMS.  So with the loader thread and the initial thread both doing operations against the RawStore they sometimes mess up each others transaction stack.  In a quick test I used HMSHandler.newRawStoreForConf() to fix this, which seemed to work.

      A reference to the TxnHandler is also called.  I suspect this will run into a similar issue.

      Attachments

        1. HIVE-18776.01.patch
          8 kB
          jcamachorodriguez
        2. HIVE-18776.02.patch
          8 kB
          jcamachorodriguez
        3. HIVE-18776.patch
          7 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              gates Alan Gates
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: