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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]