Repository: hive Updated Branches: refs/heads/master 917221e83 -> 6dace60af
tune TxnHandler.performTimeOuts() batch size (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/6dace60a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/6dace60a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/6dace60a Branch: refs/heads/master Commit: 6dace60af4b6ab4d5200310a0ad94c4530c2bec3 Parents: 917221e Author: Eugene Koifman <ekoif...@hortonworks.com> Authored: Wed Mar 1 11:27:59 2017 -0800 Committer: Eugene Koifman <ekoif...@hortonworks.com> Committed: Wed Mar 1 11:27:59 2017 -0800 ---------------------------------------------------------------------- .../src/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java | 3 ++- .../src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/6dace60a/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 c0518ad..01acba5 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 @@ -3050,7 +3050,8 @@ abstract class TxnHandler implements TxnStore, TxnStore.MutexAPI { stmt = dbConn.createStatement(); String s = " txn_id from TXNS where txn_state = '" + TXN_OPEN + "' and txn_last_heartbeat < " + (now - timeout); - s = sqlGenerator.addLimitClause(250 * TIMED_OUT_TXN_ABORT_BATCH_SIZE, s); + //safety valve for extreme cases + s = sqlGenerator.addLimitClause(10 * TIMED_OUT_TXN_ABORT_BATCH_SIZE, s); LOG.debug("Going to execute query <" + s + ">"); rs = stmt.executeQuery(s); if(!rs.next()) { http://git-wip-us.apache.org/repos/asf/hive/blob/6dace60a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java ---------------------------------------------------------------------- diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java index 041d55b..a4d9183 100644 --- a/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java +++ b/metastore/src/java/org/apache/hadoop/hive/metastore/txn/TxnStore.java @@ -58,7 +58,7 @@ public interface TxnStore { static final public String SUCCEEDED_RESPONSE = "succeeded"; static final public String ATTEMPTED_RESPONSE = "attempted"; - public static final int TIMED_OUT_TXN_ABORT_BATCH_SIZE = 1000; + public static final int TIMED_OUT_TXN_ABORT_BATCH_SIZE = 50000; public void setConf(HiveConf conf);