You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Lefty Leverenz (JIRA)" <ji...@apache.org> on 2017/05/25 03:27:04 UTC

[jira] [Commented] (HIVE-16743) BitSet set() is incorrectly used in TxnUtils.createValidCompactTxnList()

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

Lefty Leverenz commented on HIVE-16743:
---------------------------------------

[~wzheng], the commits to master and branch hive-14535 omitted the JIRA number.  Please update errata.txt for commit 1c3039333ba71665e8b954fbee88188757bb4050.  Thanks.

Example of updating errata.txt:  HIVE-11876. 

> BitSet set() is incorrectly used in TxnUtils.createValidCompactTxnList()
> ------------------------------------------------------------------------
>
>                 Key: HIVE-16743
>                 URL: https://issues.apache.org/jira/browse/HIVE-16743
>             Project: Hive
>          Issue Type: Bug
>          Components: Transactions
>    Affects Versions: 3.0.0
>            Reporter: Wei Zheng
>            Assignee: Wei Zheng
>             Fix For: 3.0.0
>
>         Attachments: HIVE-16743.1.patch
>
>
> The second line is problematic
> {code}
>     BitSet bitSet = new BitSet(exceptions.length);
>     bitSet.set(0, bitSet.length()); // for ValidCompactorTxnList, everything in exceptions are aborted
> {code}
> For example, exceptions' length is 2. We declare a BitSet object with initial size of 2 via the first line above. But that's not the actual size of the BitSet. So bitSet.length() will still return 0.
> The intention of the second line above is to set all the bits to true. This was not achieved because bitSet.set(0, bitSet.length()) is equivalent to bitSet.set(0, 0).



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