Zheng Hu created HBASE-22937:
--------------------------------

             Summary: The RawBytesComparator in branch-1 have wrong comparison 
order
                 Key: HBASE-22937
                 URL: https://issues.apache.org/jira/browse/HBASE-22937
             Project: HBase
          Issue Type: Bug
            Reporter: Zheng Hu
            Assignee: Zheng Hu


When digging the HBASE-22862, we found a bug in 
RawBytesComparator#compareOnlyKeyPortion  (although it's unrelated to the 
corruption in HBASE-22862). 
{code}
    @Override
    @VisibleForTesting
    public int compareOnlyKeyPortion(Cell left, Cell right) {
        // ...
      return (0xff & left.getTypeByte()) - (0xff & right.getTypeByte());
    }
{code}

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.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to