Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-14535 add insert-only ACID tables to Hive
  3. HIVE-17647

DDLTask.generateAddMmTasks(Table tbl) and other random code should not start transactions

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • Transactions

    Description

      This method (and other places) have

            if (txnManager.isTxnOpen()) {
              mmWriteId = txnManager.getCurrentTxnId();
            } else {
              mmWriteId = txnManager.openTxn(new Context(conf), conf.getUser());
              txnManager.commitTxn();
            }
      

      this should throw if there is no open transaction. It should never open one.

      In general the logic seems suspect. Looks like the intent is to move all existing files into a delta_x_x/ when a plain table is converted to MM table. This seems like something that needs to be done from under an Exclusive lock to prevent concurrent Insert operations writing data under table/partition root. But this is too late to acquire locks which should be done from the Driver.acquireLocks() (or else have deadlock detector since acquiring them here would bread all-or-nothing lock acquisition semantics currently required w/o deadlock detector)

      Attachments

        1. HIVE-17647.01.patch
          54 kB
          Sergey Shelukhin
        2. HIVE-17647.02.patch
          54 kB
          Sergey Shelukhin
        3. HIVE-17647.03.patch
          57 kB
          Sergey Shelukhin
        4. HIVE-17647.04.patch
          57 kB
          Sergey Shelukhin
        5. HIVE-17647.05.patch
          57 kB
          Sergey Shelukhin
        6. HIVE-17647.patch
          53 kB
          Sergey Shelukhin

        Issue Links

          Activity

            People

              sershe Sergey Shelukhin
              ekoifman Eugene Koifman
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: