[
https://issues.apache.org/jira/browse/HBASE-21572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lixiaobao updated HBASE-21572:
------------------------------
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.
{code:java}
this.progress = new CompactionProgress(fd.maxKeyCount);{code}
# The code below may also case thread-safe problem when two or more threads
execute compaction on one store
{code:java}
++progress.currentCompactedKVs;
progress.totalCompactedSize += len;{code}
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.
was:
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.
{code:java}
this.progress = new CompactionProgress(fd.maxKeyCount);{code}
# The code below may also case thread-safe problem when two or more threads
execute compaction on one store
{code:java}
++progress.currentCompactedKVs;
progress.totalCompactedSize += len;{code}
solutions:
# I create a list of "CompactionProgress" in the compactor of one store,every
thread execute compaction just add progress to the list,when compelete remove
progress in the list.
> The "progress" object in "Compactor" is not thread-safe, this may cause the
> misleading progress information on the web UI.
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-21572
> URL: https://issues.apache.org/jira/browse/HBASE-21572
> Project: HBase
> Issue Type: Bug
> Components: Compaction, UI
> Affects Versions: 1.2.0, 3.0.0, 1.3.0, 1.4.0, 2.1.0, 2.0.0
> Reporter: lixiaobao
> Assignee: lixiaobao
> Priority: Major
> Fix For: 3.0.0
>
> Attachments: HBASE-21572.patch
>
>
> 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.
> {code:java}
> this.progress = new CompactionProgress(fd.maxKeyCount);{code}
> # The code below may also case thread-safe problem when two or more threads
> execute compaction on one store
> {code:java}
> ++progress.currentCompactedKVs;
> progress.totalCompactedSize += len;{code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)