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

Exclusive locks are not acquired when using dynamic partitions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: Locking
    • Labels:
      None

      Description

      If locking is enabled, the acquireReadWriteLocks() method in org.apache.hadoop.hive.ql.Driver iterates through all of the input and output entities of the query plan and attempts to acquire the appropriate locks. In general, it should acquire SHARED locks for all of the input entities and exclusive locks for all of the output entities (see the Hive wiki page on locking for more detailed information).

      When the query involves dynamic partitions, the situation is a little more subtle. As the Hive wiki notes (see previous link):

      in some cases, the list of objects may not be known - for eg. in case of dynamic partitions, the list of partitions being modified is not known at compile time - so, the list is generated conservatively. Since the number of partitions may not be known, an exclusive lock is taken on the table, or the prefix that is known.

      After HIVE-1781, the observed behavior is no longer consistent with the behavior described above. HIVE-1781 appears to have altered the logic so that SHARED locks are acquired instead of EXCLUSIVE locks whenever the query involves dynamic partitions.

        Attachments

        1. HIVE-3509.D10065.5.patch
          111 kB
          Phabricator
        2. HIVE-3509.D10065.4.patch
          78 kB
          Phabricator
        3. HIVE-3509.D10065.3.patch
          78 kB
          Phabricator
        4. HIVE-3509.D10065.2.patch
          52 kB
          Phabricator
        5. HIVE-3509.D10065.1.patch
          45 kB
          Phabricator
        6. HIVE-3509.1.patch.txt
          2 kB
          Matt Martin

          Activity

            People

            • Assignee:
              matt.martin Matt Martin
              Reporter:
              matt.martin Matt Martin
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: