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

Skip compaction request/check for replica regions at the early stage.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: read replicas
    • Labels:
      None

      Description

      I found that in certain cases replica regions can trigger compaction, one example as follows, need to check all places to avoid compaction for replica regions.

      @Override
      public void postOpenDeployTasks(final PostOpenDeployContext context) throws IOException {
        HRegion r = context.getRegion();
        long openProcId = context.getOpenProcId();
        long masterSystemTime = context.getMasterSystemTime();
        rpcServices.checkOpen();
        LOG.info("Post open deploy tasks for {}, openProcId={}, masterSystemTime={}",
          r.getRegionInfo().getRegionNameAsString(), openProcId, masterSystemTime);
        // Do checks to see if we need to compact (references or too many files)
        // TODO: SHX, do not do this for replica regions? Otherwise, it is going to lost data locality for primary regions.
        for (HStore s : r.stores.values()) {
          if (s.hasReferences() || s.needsCompaction()) {
            this.compactSplitThread.requestSystemCompaction(r, s, "Opening Region");
          }
        }
       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                huaxiangsun Huaxiang Sun
                Reporter:
                huaxiangsun Huaxiang Sun
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: