FAQ
Repository: hive
Updated Branches:
   refs/heads/branch-2.1 a72a2ea2b -> 48c1b3c70


HIVE-13959: MoveTask should only release its query associated locks (Chaoyu Tang, reviewed by Yongzhi Chen)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/48c1b3c7
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/48c1b3c7
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/48c1b3c7

Branch: refs/heads/branch-2.1
Commit: 48c1b3c707d4d110cde4818812be01b6799ab9d5
Parents: a72a2ea
Author: ctang <ctang@cloudera.com>
Authored: Tue Jun 14 17:14:57 2016 -0400
Committer: ctang <ctang@cloudera.com>
Committed: Tue Jun 14 17:17:30 2016 -0400

----------------------------------------------------------------------
  .../org/apache/hadoop/hive/ql/exec/MoveTask.java | 16 ++++++++++++----
  1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/48c1b3c7/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
index aeaae6b..12b3b1f 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
@@ -50,6 +50,7 @@ import org.apache.hadoop.hive.ql.io.merge.MergeFileTask;
  import org.apache.hadoop.hive.ql.lockmgr.HiveLock;
  import org.apache.hadoop.hive.ql.lockmgr.HiveLockManager;
  import org.apache.hadoop.hive.ql.lockmgr.HiveLockObj;
+import org.apache.hadoop.hive.ql.lockmgr.LockException;
  import org.apache.hadoop.hive.ql.metadata.Hive;
  import org.apache.hadoop.hive.ql.metadata.HiveException;
  import org.apache.hadoop.hive.ql.metadata.Partition;
@@ -214,10 +215,17 @@ public class MoveTask extends Task<MoveWork> implements Serializable {
        List<HiveLock> locks = lockMgr.getLocks(lockObj.getObj(), false, true);
        for (HiveLock lock : locks) {
          if (lock.getHiveLockMode() == lockObj.getMode()) {
- LOG.info("about to release lock for output: " + output.toString() +
- " lock: " + lock.getHiveLockObject().getName());
- lockMgr.unlock(lock);
- ctx.getHiveLocks().remove(lock);
+ if (ctx.getHiveLocks().remove(lock)) {
+ LOG.info("about to release lock for output: " + output.toString() +
+ " lock: " + lock.getHiveLockObject().getName());
+ try {
+ lockMgr.unlock(lock);
+ } catch (LockException le) {
+ // should be OK since the lock is ephemeral and will eventually be deleted
+ // when the query finishes and zookeeper session is closed.
+ LOG.warn("Could not release lock " + lock.getHiveLockObject().getName());
+ }
+ }
          }
        }
      }

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 14, '16 at 9:15p
activeJun 14, '16 at 9:22p
posts2
users1
websitehive.apache.org

1 user in discussion

Ctang: 2 posts

People

Translate

site design / logo © 2021 Grokbase