Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1472

SaltingUtil calculates wrong salt key for Integer.MIN_VALUE hash code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.3.0, 3.3.0, 3.2.2, 4.2.2
    • None
    • None

    Description

      There is an edge case in SaltingUtil.getSaltingByte where an invalid salt byte is calculated. This happens when the hash code of the row key being salted is equal to Integer.MIN_VALUE. The underlying bug is the use of Math.abs(hashCode) in SaltingUtil.getSaltingByte, and the result of the bug is that a hash code outside of the range of configured salt buckets can be returned.

      Attachments

        1. PHOENIX-1472.patch
          4 kB
          Gabriel Reid
        2. PHOENIX-1472.1.patch
          4 kB
          Gabriel Reid

        Activity

          People

            gabriel.reid Gabriel Reid
            gabriel.reid Gabriel Reid
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: