deniskuzZ commented on a change in pull request #2068:
URL: https://github.com/apache/hive/pull/2068#discussion_r598624457



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -5067,6 +5069,25 @@ private void timeOutLocks(Connection dbConn) {
    */
   @RetrySemantics.Idempotent
   public void performTimeOuts() {
+    try {
+      // time out non-replication txns
+      String epochFn = getEpochFn(dbProduct);
+      String timeoutTxnsQuery = " \"TXN_ID\" FROM \"TXNS\" WHERE \"TXN_STATE\" 
= " + TxnStatus.OPEN +
+              " AND \"TXN_LAST_HEARTBEAT\" <  " + epochFn + "-" + timeout +
+              " AND \"TXN_TYPE\" != " + TxnType.REPL_CREATED.getValue();
+      performTimeOutsInternal(timeoutTxnsQuery);

Review comment:
       Why do we need 2 db connections here to perform the timeout? Could we 
change this to a single query to avoid doing FULL table scan several times?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to