Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-15339 Improve DateTieredCompactionPolicy
  3. HBASE-15400

Use DateTieredCompactor for Date Tiered Compaction

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 0.98.19, 2.0.0
    • Compaction
    • None
    • Reviewed
    • Hide
      With this patch combined with HBASE-15389, when we compact, we can output multiple files along the current window boundaries. There are two use cases:
      1. Major compaction: We want to output date tiered store files with data older than max age archived in trunks of the window size on the higher tier. Once a window is old enough, we don't combine the windows to promote to the next tier any further. So files in these windows retain the same timespan as they were minor-compacted last time, which is the window size of the highest tier. Major compaction will touch these files and we want to maintain the same layout. This way, TTL and archiving will be simpler and more efficient.
      2. Bulk load files and the old file generated by major compaction before upgrading to DTCP.

      This will change the way to enable date tiered compaction.
      To turn it on:
      hbase.hstore.engine.class: org.apache.hadoop.hbase.regionserver.DateTieredStoreEngine

      With tiered compaction all servers in the cluster will promote windows to higher tier at the same time, so using a compaction throttle is recommended:
      hbase.regionserver.throughput.controller:org.apache.hadoop.hbase.regionserver.compactions.PressureAwareCompactionThroughputController
      hbase.hstore.compaction.throughput.higher.bound and hbase.hstore.compaction.throughput.lower.bound need to be set for desired throughput range as uncompressed rates.

      Because there will most likely be more store files around, we need to adjust the configuration so that flush won't be blocked and compaction will be properly throttled:
      hbase.hstore.blockingStoreFiles: change to 50 if using all default parameters when turning on date tiered compaction. Use 1.5~2 x projected file count if changing the parameters, Projected file count = windows per tier x tier count + incoming window min + files older than max age

      Because major compaction is turned on now, we also need to adjust the configuration for max file to compact according to the larger file count:
      hbase.hstore.compaction.max: set to the same number as hbase.hstore.blockingStoreFiles.

      For more details, please refer to the design spec at https://docs.google.com/document/d/1_AmlNb2N8Us1xICsTeGDLKIqL6T-oHoRLZ323MG_uy8/edit#



      Show
      With this patch combined with HBASE-15389 , when we compact, we can output multiple files along the current window boundaries. There are two use cases: 1. Major compaction: We want to output date tiered store files with data older than max age archived in trunks of the window size on the higher tier. Once a window is old enough, we don't combine the windows to promote to the next tier any further. So files in these windows retain the same timespan as they were minor-compacted last time, which is the window size of the highest tier. Major compaction will touch these files and we want to maintain the same layout. This way, TTL and archiving will be simpler and more efficient. 2. Bulk load files and the old file generated by major compaction before upgrading to DTCP. This will change the way to enable date tiered compaction. To turn it on: hbase.hstore.engine.class: org.apache.hadoop.hbase.regionserver.DateTieredStoreEngine With tiered compaction all servers in the cluster will promote windows to higher tier at the same time, so using a compaction throttle is recommended: hbase.regionserver.throughput.controller:org.apache.hadoop.hbase.regionserver.compactions.PressureAwareCompactionThroughputController hbase.hstore.compaction.throughput.higher.bound and hbase.hstore.compaction.throughput.lower.bound need to be set for desired throughput range as uncompressed rates. Because there will most likely be more store files around, we need to adjust the configuration so that flush won't be blocked and compaction will be properly throttled: hbase.hstore.blockingStoreFiles: change to 50 if using all default parameters when turning on date tiered compaction. Use 1.5~2 x projected file count if changing the parameters, Projected file count = windows per tier x tier count + incoming window min + files older than max age Because major compaction is turned on now, we also need to adjust the configuration for max file to compact according to the larger file count: hbase.hstore.compaction.max: set to the same number as hbase.hstore.blockingStoreFiles. For more details, please refer to the design spec at https://docs.google.com/document/d/1_AmlNb2N8Us1xICsTeGDLKIqL6T-oHoRLZ323MG_uy8/edit#

    Description

      When we compact, we can output multiple files along the current window boundaries. There are two use cases:

      1. Major compaction: We want to output date tiered store files with data older than max age archived in trunks of the window size on the higher tier. Once a window is old enough, we don't combine the windows to promote to the next tier any further. So files in these windows retain the same timespan as they were minor-compacted last time, which is the window size of the highest tier. Major compaction will touch these files and we want to maintain the same layout. This way, TTL and archiving will be simpler and more efficient.

      2. Bulk load files and the old file generated by major compaction before upgrading to DTCP.

      Pros:
      1. Restore locality, process versioning, updates and deletes while maintaining the tiered layout.
      2. The best way to fix a skewed layout.

      This work is based on a prototype of DateTieredCompactor from HBASE-15389 and focused on the part to meet needs for these two use cases while supporting others. I have to call out a few design decisions:

      1. We only want to output the files along all windows for major compaction. And we want to output multiple files older than max age in the trunks of the maximum tier window size determined by base window size, windows per tier and max age.

      2. For minor compaction, we don't want to output too many files, which will remain around because of current restriction of contiguous compaction by seq id. I will only output two files if all the files in the windows are being combined, one for the data within window and the other for the out-of-window tail. If there is any file in the window excluded from compaction, only one file will be output from compaction. When the windows are promoted, the situation of out of order data will gradually improve. For the incoming window, we need to accommodate the case with user-specified future data.

      3. We have to pass the boundaries with the list of store file as a complete time snapshot instead of two separate calls because window layout is determined by the time the computation is called. So we will need new type of compaction request.

      4. Since we will assign the same seq id for all output files, we need to sort by maxTimestamp subsequently. Right now all compaction policy gets the files sorted for StoreFileManager which sorts by seq id and other criteria. I will use this order for DTCP only, to avoid impacting other compaction policies.

      5. We need some cleanup of current design of StoreEngine and CompactionPolicy.

      Attachments

        1. HBASE-15400-v7.patch
          98 kB
          Clara Xiong
        2. HBASE-15400-v6.patch
          98 kB
          Clara Xiong
        3. HBASE-15400-v3-v5.patch
          98 kB
          Clara Xiong
        4. HBASE-15400-v3-v4.patch
          98 kB
          Clara Xiong
        5. HBASE-15400-v3-v3.patch
          97 kB
          Clara Xiong
        6. HBASE-15400-v3.patch
          96 kB
          Clara Xiong
        7. HBASE-15400-v1.pa
          84 kB
          Clara Xiong
        8. HBASE-15400-branch-1.patch
          98 kB
          Clara Xiong
        9. HBASE-15400-15389-v12.patch
          96 kB
          Clara Xiong
        10. HBASE-15400-0.98.patch
          96 kB
          Clara Xiong
        11. HBASE-15400.patch
          75 kB
          Clara Xiong

        Issue Links

          Activity

            People

              clarax98007 Clara Xiong
              clarax98007 Clara Xiong
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: