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

Midkey metadata in root index block would always be ignored by BlockIndexReader.readMultiLevelIndexRoot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-4, 2.4.17, 2.5.5, 4.0.0-alpha-1
    • 2.6.0, 2.4.18, 2.5.6, 3.0.0-beta-1
    • HFile
    • None

    Description

      After HBASE-27053, checksum is removed from the HFileBlock ByteBuff in FSReaderImpl.readBlockDataInternal once the checksum is verified, so HFileBlock.buf does not include checksum, but for BlockIndexReader.readMultiLevelIndexRoot, after read root index entries , it still subtracts the checksum to check if the midkey metadat exists, the midkey metadata would always be ignored:

      public void readMultiLevelIndexRoot(HFileBlock blk, final int numEntries) throws IOException {
            DataInputStream in = readRootIndex(blk, numEntries);
            // after reading the root index the checksum bytes have to
            // be subtracted to know if the mid key exists.
            int checkSumBytes = blk.totalChecksumBytes();
            if ((in.available() - checkSumBytes) < MID_KEY_METADATA_SIZE) {
              // No mid-key metadata available.
              return;
            }
            midLeafBlockOffset = in.readLong();
            midLeafBlockOnDiskSize = in.readInt();
            midKeyEntry = in.readInt();
       }
      

      Attachments

        Issue Links

          Activity

            People

              comnetwork chenglei
              comnetwork chenglei
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: