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

Major compaction may not be triggered, even though region server log says it is triggered

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 0.92.0
    • regionserver
    • None
    • Reviewed

    Description

      The trunk version of regionserver/Store.java, method List<StoreFile> compactSelection(List<StoreFile> candidates) has this code to determine whether major compaction should be done or not:

      // major compact on user action or age (caveat: we have too many files)
      boolean majorcompaction = (forcemajor || isMajorCompaction(filesToCompact))
      && filesToCompact.size() < this.maxFilesToCompact;

      The isMajorCompaction(filesToCompact) method internally determines whether or not major compaction is required (and logs this as "Major compaction triggered ... " log message. However, after the call, the compactSelection method subsequently applies the filesToCompact.size() < this.maxFilesToCompact check which can turn off major compaction.

      This would result in a "Major compaction triggered" log message without actually triggering a major compaction.

      The filesToCompact.size() check should probably be moved inside the isMajorCompaction(filesToCompact) method.

      Attachments

        1. 4024-v3.txt
          0.8 kB
          Ted Yu
        2. 4024-v2.txt
          1 kB
          Ted Yu
        3. 4024.txt
          1 kB
          Ted Yu

        Activity

          People

            yuzhihong@gmail.com Ted Yu
            svarma Suraj Varma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: