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

Verify the files when RegionServer is starting and BucketCache is in file mode

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.6, 1.4.10, 1.3.5
    • Fix Version/s: 1.5.0, 1.4.11
    • Component/s: BucketCache
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      Verify cache file integrity before BucketCache retrieve from file if the IOEngine is persistent. Prevent inconsistency between backingMap and cache file if cache file has been modified.

      The process of verifying integrity is to compare checksum. The checksum is calculated using java.security.MessageDigest class according to cache files full path, actual size and last modified time.

      The encryption algorithms is configurable and default is MD5. The configuration option is : hbase.bucketcache.persistent.file.integrity.check.algorithm
      Show
      Verify cache file integrity before BucketCache retrieve from file if the IOEngine is persistent. Prevent inconsistency between backingMap and cache file if cache file has been modified. The process of verifying integrity is to compare checksum. The checksum is calculated using java.security.MessageDigest class according to cache files full path, actual size and last modified time. The encryption algorithms is configurable and default is MD5. The configuration option is : hbase.bucketcache.persistent.file.integrity.check.algorithm

      Description

      We use FileIOEngine in BucketCache and have configured <hbase.bucketcache.persistent.path>.  If the RegionServer is stopped, and the cache data file or the backingMap persistence file is deleted or changed before the RegionServer is restarted. When restart RegionServer, the backingMap and cache data are Inconsistent, and get or scan command will get IOException like follows:

      bucket.BucketCache: Failed reading block 18951416e2ca4e8bbc11523f4f5ea576_1125745279 from bucket cache
      java.io.IOException: Invalid HFile block magic: \x00\x00\x00\x00\x00\x00\x00\x00
      at org.apache.hadoop.hbase.io.hfile.BlockType.parse(BlockType.java:154)
      at org.apache.hadoop.hbase.io.hfile.BlockType.read(BlockType.java:167)
      at org.apache.hadoop.hbase.io.hfile.HFileBlock.<init>(HFileBlock.java:347)
      at org.apache.hadoop.hbase.io.hfile.HFileBlock$1.deserialize(HFileBlock.java:247)
      at org.apache.hadoop.hbase.io.hfile.HFileBlock$1.deserialize(HFileBlock.java:226)
      at org.apache.hadoop.hbase.io.hfile.bucket.BucketCache.getBlock(BucketCache.java:514)

      ......

        Attachments

        1. HBASE-22890.branch-1.0001.patch
          11 kB
          Baiqiang Zhao

          Issue Links

            Activity

              People

              • Assignee:
                DeanZ Baiqiang Zhao
                Reporter:
                DeanZ Baiqiang Zhao
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: