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

Rewrite calculation of midpoint in binarySearch functions to prevent overflow

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.5.0, 2.2.0
    • io
    • None
    • 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-addendum.patch
          1 kB
          Xu Cang
        2. HBASE-20928-fix-binarySearch-v5.patch
          6 kB
          saurabh singh
        3. HBASE-20928-fix-binarySearch-v5.patch
          6 kB
          saurabh singh

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: