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

Fix Improper bitwise & in BucketCache offset calculation

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      Offset calculation for BucketCache entries incorrectly uses an int literal to try to ensure that the offset is positive. However, because it uses the string literal 0xFFFFFFFF which java uses at an int (which is negative). When it does the bitwise &, java sign extends the int effectively undoing the original intention of the code and allowing for negative values to slip through.
      Then the read or write to that block will fail due to trying to read/write at a negative index which causes the BucketCache to fail.

      Attachments

        1. HBASE-18757.master.001.patch
          3 kB
          Zach York
        2. HBASE-18757.master.002.patch
          3 kB
          Zach York
        3. HBASE-18757.branch-1.3.001.patch
          2 kB
          Zach York

        Issue Links

          Activity

            People

              zyork Zach York
              zyork Zach York
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: