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

The "progress" object in "Compactor" is not thread-safe, this may cause the misleading progress information on the web UI.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0, 3.0.0-alpha-1, 1.3.0, 1.4.0, 2.1.0, 2.0.0
    • Fix Version/s: 3.0.0-alpha-1
    • Component/s: Compaction, UI
    • Labels:
      None

      Description

      when setting the compaction thread number more than 1, on the store, there may be multiple threads on the region server using "compactor" of the "store" to execute the compaction . However, the "progress" object in "Compactor" is not thread-safe, this may cause the misleading progress information on the web UI.

      The problem is:

      1. If the memstore frequent flush , there may be two or more compaction request on one store, however, one "store" has one "compactor" and one "compactor" has one "progress",when two threads execute compaction on one store ,the code below may have some problem."progress" will be override by lastest thread.
        this.progress = new CompactionProgress(fd.maxKeyCount);
      1. The code below may also case thread-safe problem when two or more threads execute compaction on one store
         ++progress.currentCompactedKVs;
         progress.totalCompactedSize += len;

      solutions:

      1. I create a list of "CompactionProgress" in the "compactor" ,every thread execute compaction just add progress to the list,when complete remove "progress" in the list. 

        Attachments

        1. HBASE-21572.patch
          11 kB
          lixiaobao

          Activity

            People

            • Assignee:
              q977734161 lixiaobao
              Reporter:
              q977734161 lixiaobao
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Due:
                Created:
                Updated: