[ https://issues.apache.org/jira/browse/HIVE-25246?focusedWorklogId=612431&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-612431 ]
ASF GitHub Bot logged work on HIVE-25246: ----------------------------------------- Author: ASF GitHub Bot Created on: 21/Jun/21 04:37 Start Date: 21/Jun/21 04:37 Worklog Time Spent: 10m Work Description: pkumarsinha commented on a change in pull request #2396: URL: https://github.com/apache/hive/pull/2396#discussion_r655067789 ########## File path: ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java ########## @@ -244,8 +245,16 @@ public void testAbortTxns() throws Exception { List<Long> txnList = openedTxns.getTxn_ids(); txnHandler.abortTxns(new AbortTxnsRequest(txnList)); + OpenTxnRequest replRqst = new OpenTxnRequest(2, "me", "localhost"); + replRqst.setReplPolicy("default.*"); + replRqst.setReplSrcTxnIds(Arrays.asList(1L, 2L)); + List<Long> targetTxns = txnHandler.openTxns(replRqst).getTxn_ids(); + txnHandler.abortTxns(new AbortTxnsRequest(targetTxns)); + + assertFalse(targetTxnsPresentInReplTxnMap(targetTxns)); Review comment: Test REPL_TXN_TIMEOUT case as well ########## File path: ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java ########## @@ -244,8 +245,16 @@ public void testAbortTxns() throws Exception { List<Long> txnList = openedTxns.getTxn_ids(); txnHandler.abortTxns(new AbortTxnsRequest(txnList)); + OpenTxnRequest replRqst = new OpenTxnRequest(2, "me", "localhost"); + replRqst.setReplPolicy("default.*"); + replRqst.setReplSrcTxnIds(Arrays.asList(1L, 2L)); + List<Long> targetTxns = txnHandler.openTxns(replRqst).getTxn_ids(); Review comment: Assert that these are REPLAYED txns. ########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java ########## @@ -4714,6 +4714,12 @@ private int abortTxns(Connection dbConn, List<Long> txnids, boolean checkHeartbe prefix.append("DELETE FROM \"HIVE_LOCKS\" WHERE "); TxnUtils.buildQueryWithINClause(conf, queries, prefix, suffix, txnids, "\"HL_TXNID\"", false, false); + // Delete mapping from REPL_TXN_MAP if it exists. + prefix.setLength(0); + suffix.setLength(0); + prefix.append("DELETE FROM \"REPL_TXN_MAP\" WHERE "); Review comment: This is applicable only for the replayed transactions and not all. -- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 612431) Time Spent: 20m (was: 10m) > Fix the clean up of open repl created transactions > -------------------------------------------------- > > Key: HIVE-25246 > URL: https://issues.apache.org/jira/browse/HIVE-25246 > Project: Hive > Issue Type: Improvement > Reporter: Haymant Mangla > Assignee: Haymant Mangla > Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > -- This message was sent by Atlassian Jira (v8.3.4#803005)