hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wei Zheng (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-16743) BitSet set() is not incorrectly used in TxnUtils.createValidCompactTxnList()
Date Wed, 24 May 2017 02:41:04 GMT

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

Wei Zheng commented on HIVE-16743:
----------------------------------

My understanding is this newly added BitSet currently has no client which is using it - it's
only used by isTxnAborted() and isTxnRangeAborted(). Although readFromString() and writeToString()
also use it, but the fact that it was constructed incorrectly doesn't impact the serialization/deserialization.

p.s. my unit test in other ticket already verified isTxnAborted()/isTxnRangeAborted() is working
with this fix :)

> BitSet set() is not 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
>         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)

Mime
View raw message