Details
Description
While using FuzzyRowFilter we noticed that if the mask array consists of all 0s (fixed) the FuzzyRowFilter matches all the rows in the table. We noticed this on HBase 1.1, 1.2 and higher.
After some digging we suspect that this is because of isPreprocessedMask() check which is used in preprocessMask() which was added here: https://issues.apache.org/jira/browse/HBASE-13761
If the mask consists of all 0s then the isPreprocessedMask() returns true and the preprocessing which responsible for changing 0s to -1 doesn't happen and hence all rows are matched in scan.
This scenario can be tested in TestFuzzyRowFilterEndToEnd#testHBASE14782() If we change the
byte[] fuzzyKey = Bytes.toBytesBinary("\\x00\\x00
x044");
byte[] mask = new byte[]
;
to
byte[] fuzzyKey = Bytes.toBytesBinary("\\x9B\\x00
x044e");
byte[] mask = new byte[]
;
We expect one match but this will match all the rows in the table.