Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.2.0, 3.0.0-alpha-1, 1.3.0, 1.4.0, 2.1.0, 2.0.0
-
None
-
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:
- 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);
- 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:
- 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.