Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20928

Rewrite calculation of midpoint in binarySearch functions to prevent overflow

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0, 2.2.0
    • Component/s: io
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      There are couple of issues in the function:

      • >>> operator would mess the values if low + high end up being negative. This shouldn't happen but I don't see anything to prevent this from happening.

       

      Most of the code should already be covered by tests. I would have liked to add a test that actually fails without the fix but given these are private methods I am not sure on the best place to add the test. Suggestions?

        Attachments

        1. HBASE-20928-fix-binarySearch-v5.patch
          6 kB
          saurabh singh
        2. HBASE-20928-fix-binarySearch-v5.patch
          6 kB
          saurabh singh
        3. HBASE-20928-addendum.patch
          1 kB
          Xu Cang

          Issue Links

            Activity

              People

              • Assignee:
                bashrc-real saurabh singh
                Reporter:
                bashrc-real saurabh singh
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: