You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2015/09/25 03:40:08 UTC

[30/50] [abbrv] hive git commit: HIVE-11902 - Abort txn cleanup thread throws SyntaxErrorException (Deepesh Khandelwal via Eugene Koifman)

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/beeline-cli
Commit: 5a5539c36ef2e473edb143dc4320f33e7f380891
Parents: 44741da
Author: Eugene Koifman <ek...@hortonworks.com>
Authored: Tue Sep 22 15:44:16 2015 -0700
Committer: Eugene Koifman <ek...@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();