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

Refactor MetaStoreDirectSql constructor by removing DB queries out of critical section

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.0.0
    • None
    • Metastore
    • None

    Description

      MetaStoreDirectSql constructor is querying DB to determine dbType, which leads to too many DB queries to make megastore slow as ObjectStore.setConf might be called frequently. Moreover, ObjectStore.setConf begins/ends with lock acquire/release, if the underlying DB hangs somehow, lock is never released and all hereafter incoming requests are blocked.

      Two points:
      1. Using getProductName based JDBC driver to get dbType info.
      2. Since metastore auto-creaton is disabled by default, it'd better bypass ensureDbInit() and runTestQuery() in order to avoid DB queries within critical section of setConf.

      Here’s stack trace:
      MetaStoreDirectSql.determineDbType(...)
      MetaStoreDirectSql.MetaStoreDirectSql(...)
      ObjectStore.initialize(...)
      ObjectStore.setConf(…)

      Attachments

        1. HIVE-9741.7.patch
          4 kB
          Xiaobing Zhou
        2. HIVE-9741.6.patch
          4 kB
          Xiaobing Zhou
        3. HIVE-9741.5.patch
          4 kB
          Xiaobing Zhou
        4. HIVE-9741.4.patch
          4 kB
          Xiaobing Zhou
        5. HIVE-9741.3.patch
          4 kB
          Xiaobing Zhou
        6. HIVE-9741.2.patch
          2 kB
          Xiaobing Zhou
        7. HIVE-9741.1.patch
          2 kB
          Xiaobing Zhou

        Issue Links

          Activity

            People

              xiaobingo Xiaobing Zhou
              xiaobingo Xiaobing Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: