hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekoif...@apache.org
Subject hive git commit: HIVE-11902 - Abort txn cleanup thread throws SyntaxErrorException (Deepesh Khandelwal via Eugene Koifman)
Date Tue, 22 Sep 2015 22:50:38 GMT
Repository: hive
Updated Branches:
  refs/heads/master 44741dabf -> 5a5539c36


HIVE-11902 - Abort txn cleanup thread throws SyntaxErrorException (Deepesh Khandelwal via
Eugene Koifman)


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

Branch: refs/heads/master
Commit: 5a5539c36ef2e473edb143dc4320f33e7f380891
Parents: 44741da
Author: Eugene Koifman <ekoifman@hortonworks.com>
Authored: Tue Sep 22 15:44:16 2015 -0700
Committer: Eugene Koifman <ekoifman@hortonworks.com>
Committed: Tue Sep 22 15:44:32 2015 -0700

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


http://git-wip-us.apache.org/repos/asf/hive/blob/5a5539c3/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 9ecb82a..8597d9f 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
@@ -1302,6 +1302,9 @@ public class TxnHandler {
   private int abortTxns(Connection dbConn, List<Long> txnids) throws SQLException {
     Statement stmt = null;
     int updateCnt = 0;
+    if (txnids.isEmpty()) {
+      return 0;
+    }
     try {
       stmt = dbConn.createStatement();
 
@@ -1921,7 +1924,7 @@ public class TxnHandler {
           abortTxns(dbConn, batchToAbort);
           dbConn.commit();
           //todo: add TXNS.COMMENT filed and set it to 'aborted by system due to timeout'
-          LOG.info("Aborted the following transactions due to timeout: " + timedOutTxns.toString());
+          LOG.info("Aborted the following transactions due to timeout: " + batchToAbort.toString());
         }
         int numTxnsAborted = (timedOutTxns.size() - 1) * TIMED_OUT_TXN_ABORT_BATCH_SIZE +
           timedOutTxns.get(timedOutTxns.size() - 1).size();


Mime
View raw message