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

The RawBytesComparator in branch-1 have wrong comparison order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0, 1.3.6, 1.4.11
    • None
    • None
    • Reviewed

    Description

      When digging the HBASE-22862, we found a bug in RawBytesComparator#compareOnlyKeyPortion (although it's unrelated to the corruption in HBASE-22862).

          @Override
          @VisibleForTesting
          public int compareOnlyKeyPortion(Cell left, Cell right) {
              // ...
            return (0xff & left.getTypeByte()) - (0xff & right.getTypeByte());
          }
      

      Here should be (0xff & right.getTypeByte()) - (0xff & left.getTypeByte()) I think.

      I can see the BloomFilter or HFile v2 are still using the comparator in branch-1 (but not in branch-2). Maybe we can just remove the class (if some HFile encoded with this comparator, then mapping to the correct KVComparator just like 2.x), or fix the bug in current RawBytesComparator.

      Attachments

        Issue Links

          Activity

            People

              openinx Zheng Hu
              openinx Zheng Hu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: