[ 
https://issues.apache.org/jira/browse/HIVE-16534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15989305#comment-15989305
 ] 

Wei Zheng commented on HIVE-16534:
----------------------------------

We can drop this:
{code}
    while (txnId <= maxTxnId) {
      firstAbortedTxnIndex = Arrays.binarySearch(exceptions, txnId);
      if (firstAbortedTxnIndex >= 0) {
        break;
      }
      txnId++;
    }
{code}
The main usage of above code is to locate the index for first aborted txn in 
the range so that we can save some unnecessary iterations when scanning the 
BitSet. But in your example which is very likely to be a common situation, this 
is not acceptable.

Considering the BitSet is not big (comparing to the gap between 5 and 1000000), 
we can just start from index 0 and scan thru the BitSet. I think this should be 
ok.

> Add capability to tell aborted transactions apart from open transactions in 
> ValidTxnList
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-16534
>                 URL: https://issues.apache.org/jira/browse/HIVE-16534
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>            Reporter: Wei Zheng
>            Assignee: Wei Zheng
>         Attachments: HIVE-16534.1.patch, HIVE-16534.2.patch
>
>
> Currently in ValidReadTxnList, open transactions and aborted transactions are 
> stored together in one array. That makes it impossible to extract just 
> aborted transactions or open transactions.
> For ValidCompactorTxnList this is fine, since we only store aborted 
> transactions but no open transactions.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to