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

tables in subqueries don't get locked

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0.0
    • 1.3.0, 2.1.0
    • Locking, Transactions
    • None

    Description

      Consider

      update acidTbl set b=19 where acidTbl.b in(select I.b from nonAcidOrcTbl I where I.a = 3)
      

      noAcidOrcTbl doesn't get locked at all. (SHARED_WRITE is taken on acidTbl).
      Same for _delete_ with subquery

      This is is because the ReadEntity for nonAcidOrcTbl is skipped by

          for (ReadEntity input : plan.getInputs()) {
            if (!input.needsLock() || input.isUpdateOrDelete()) {
              // We don't want to acquire readlocks during update or delete as we'll be acquiring write
              // locks instead.
              continue;
            }
      

      whatever sets isUpdateOrDelete() flag doesn't pay attention to whether the table is written to or not.

      HIVE-10150 was a similar issue, abstractly

      Attachments

        1. HIVE-11848.patch
          4 kB
          Eugene Koifman

        Activity

          People

            ekoifman Eugene Koifman
            ekoifman Eugene Koifman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: