You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ek...@apache.org on 2016/12/01 01:17:22 UTC

[7/8] hive git commit: HIVE-15308 Create ACID table failed intermittently: due to Postgres (SQLState=25P02, ErrorCode=0) (Eugene Koifman, reviewed by Wei Zheng)

HIVE-15308 Create ACID table failed intermittently: due to Postgres (SQLState=25P02, ErrorCode=0) (Eugene Koifman, reviewed by Wei Zheng)


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

Branch: refs/heads/master
Commit: 185026a750c5cc2e5207403515c99fdf21e7dbfe
Parents: 7b24ff7
Author: Eugene Koifman <ek...@hortonworks.com>
Authored: Wed Nov 30 16:25:11 2016 -0800
Committer: Eugene Koifman <ek...@hortonworks.com>
Committed: Wed Nov 30 16:25:11 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/185026a7/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
index 6ea43b4..f2b1048 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
@@ -3260,6 +3260,11 @@ abstract class TxnHandler implements TxnStore, TxnStore.MutexAPI {
             if (!isDuplicateKeyError(ex)) {
               throw new RuntimeException("Unable to lock " + quoteString(key) + " due to: " + getMessage(ex), ex);
             }
+            //if here, it means a concrurrent acquireLock() inserted the 'key'
+
+            //rollback is done for the benefit of Postgres which throws (SQLState=25P02, ErrorCode=0) if
+            //you attempt any stmt in a txn which had an error.
+            dbConn.rollback();
           }
           rs = stmt.executeQuery(sqlStmt);
           if (!rs.next()) {