[ 
https://issues.apache.org/jira/browse/HIVE-24197?focusedWorklogId=495866&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-495866
 ]

ASF GitHub Bot logged work on HIVE-24197:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Oct/20 12:07
            Start Date: 06/Oct/20 12:07
    Worklog Time Spent: 10m 
      Work Description: pkumarsinha commented on a change in pull request #1523:
URL: https://github.com/apache/hive/pull/1523#discussion_r500213892



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -1036,15 +1026,29 @@ private String getValidWriteIdList(String dbName, 
String tblName, String validTx
     return ((validWriteIds != null) ? validWriteIds.toString() : null);
   }
 
-  private List<Long> getOpenTxns(ValidTxnList validTxnList) {
+  List<Long> getTxnsNotPresentInHiveLocksTable(ValidTxnList validTxnList) 
throws LockException {

Review comment:
       Revert back the access modifier to 'private'.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -1036,15 +1026,29 @@ private String getValidWriteIdList(String dbName, 
String tblName, String validTx
     return ((validWriteIds != null) ? validWriteIds.toString() : null);
   }
 
-  private List<Long> getOpenTxns(ValidTxnList validTxnList) {
+  List<Long> getTxnsNotPresentInHiveLocksTable(ValidTxnList validTxnList) 
throws LockException {
     long[] invalidTxns = validTxnList.getInvalidTransactions();
-    List<Long> openTxns = new ArrayList<>();
-    for (long invalidTxn : invalidTxns) {
-      if (!validTxnList.isTxnAborted(invalidTxn)) {
-        openTxns.add(invalidTxn);
+    List<Long> txnsNotPresentInHiveLocks = new ArrayList<>();
+    for (long openTxnId : invalidTxns) {
+      if (!isTxnPresentInHiveLocks(openTxnId)) {
+        txnsNotPresentInHiveLocks.add(openTxnId);
       }
     }
-    return openTxns;
+    return txnsNotPresentInHiveLocks;
+  }
+
+  /**
+   * Get if there is an entry for the txn id in the hive locks table. It can 
be in waiting state or acquired state.
+   * @param txnId
+   * @return true if the entry for the txn id is present in hive locks.
+   * @throws LockException
+   */
+  boolean isTxnPresentInHiveLocks(long txnId) throws LockException {

Review comment:
        Access modifier to 'private'.




----------------------------------------------------------------
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: 495866)
    Remaining Estimate: 0h
            Time Spent: 10m

> Check for write transactions for the db under replication at a frequent 
> interval
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-24197
>                 URL: https://issues.apache.org/jira/browse/HIVE-24197
>             Project: Hive
>          Issue Type: Task
>            Reporter: Aasha Medhi
>            Assignee: Aasha Medhi
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-24197.01.patch, HIVE-24197.02.patch, 
> HIVE-24197.03.patch, HIVE-24197.04.patch, HIVE-24197.05.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to