Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16743

BitSet set() is incorrectly used in TxnUtils.createValidCompactTxnList()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Transactions
    • None

    Description

      The second line is problematic

          BitSet bitSet = new BitSet(exceptions.length);
          bitSet.set(0, bitSet.length()); // for ValidCompactorTxnList, everything in exceptions are aborted
      

      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).

      Attachments

        1. HIVE-16743.1.patch
          4 kB
          Wei Zheng

        Issue Links

          Activity

            People

              wzheng Wei Zheng
              wzheng Wei Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: