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

FastDiffDeltaEncoder#getFirstKeyInBlock returns wrong result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.99.0, 0.96.3, 0.98.3, 0.94.21
    • None
    • None
    • Reviewed

    Description

      As Ted found,

      With this change:

      Index: hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java
      ===================================================================
      --- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java	(revision 1596579)
      +++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestReversibleScanners.java	(working copy)
      @@ -51,6 +51,7 @@
       import org.apache.hadoop.hbase.filter.FilterList.Operator;
       import org.apache.hadoop.hbase.filter.PageFilter;
       import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
      +import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
       import org.apache.hadoop.hbase.io.hfile.CacheConfig;
       import org.apache.hadoop.hbase.io.hfile.HFileContext;
       import org.apache.hadoop.hbase.io.hfile.HFileContextBuilder;
      @@ -90,6 +91,7 @@
           CacheConfig cacheConf = new CacheConfig(TEST_UTIL.getConfiguration());
           HFileContextBuilder hcBuilder = new HFileContextBuilder();
           hcBuilder.withBlockSize(2 * 1024);
      +    hcBuilder.withDataBlockEncoding(DataBlockEncoding.FAST_DIFF);
           HFileContext hFileContext = hcBuilder.build();
           StoreFile.Writer writer = new StoreFile.WriterBuilder(
               TEST_UTIL.getConfiguration(), cacheConf, fs).withOutputDir(
      

      I got:

      java.lang.AssertionError: expected:<testRow0197/testCf:testQual0000/1400712260004/Put/vlen=13/mvcc=5> but was:<testRow0198/testCf:testQual0000/1400712260004/ Put/vlen=13/mvcc=0>
      at org.junit.Assert.fail(Assert.java:88)
      at org.junit.Assert.failNotEquals(Assert.java:743)
      at org.junit.Assert.assertEquals(Assert.java:118)
      at org.junit.Assert.assertEquals(Assert.java:144)
      at org.apache.hadoop.hbase.regionserver.TestReversibleScanners.seekTestOfReversibleKeyValueScanner(TestReversibleScanners.java:533)
      at org.apache.hadoop.hbase.regionserver.TestReversibleScanners.testReversibleStoreFileScanner(TestReversibleScanners.java:108)

      After debugging, it seems the method of FastDiffDeltaEncoder#getFirstKeyInBlock become broken. And it will cause hfilescanner#seekBefore returns wrong result.

      The solution is simple, see the patch.

      Attachments

        1. 11234-trunk.addendum
          0.9 kB
          Ted Yu
        2. 11234-98-with-prefix-tree.txt
          8 kB
          Ted Yu
        3. 11234-96.patch
          1 kB
          Chunhui Shen
        4. 11234-94.patch
          1 kB
          Chunhui Shen
        5. HBASE-11234.patch
          5 kB
          Chunhui Shen

        Issue Links

          Activity

            People

              zjushch Chunhui Shen
              zjushch Chunhui Shen
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: