You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Guangxu Cheng (JIRA)" <ji...@apache.org> on 2017/02/22 01:58:44 UTC
[jira] [Commented] (HBASE-17674) Major compaction may be canceled
in CompactionChecker
[ https://issues.apache.org/jira/browse/HBASE-17674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877261#comment-15877261 ]
Guangxu Cheng commented on HBASE-17674:
---------------------------------------
[~yuzhihong@gmail.com], mind taking a look at it ? thanks
> Major compaction may be canceled in CompactionChecker
> -----------------------------------------------------
>
> Key: HBASE-17674
> URL: https://issues.apache.org/jira/browse/HBASE-17674
> Project: HBase
> Issue Type: Bug
> Components: Compaction
> Affects Versions: 2.0.0, 1.3.0, 1.2.4, 0.98.24
> Reporter: Guangxu Cheng
> Attachments: HBASE-17674-master-v1.patch
>
>
> CompactionChecker will periodically check whether a region should perform a major compaction.
> If a region should perform a major compact, a request is submitted. But before the request is submitted, the variable forceMajor is not set to true by calling triggerMajorCompaction.
> When filtering a storefile, the large storefile may cause the request to be canceled or became minor compact.
> {code:title=HRegionServer.java|borderStyle=solid}
> @Override
> protected void chore() {
> for (Region r : this.instance.onlineRegions.values()) {
> if (r == null)
> continue;
> for (Store s : r.getStores()) {
> try {
> long multiplier = s.getCompactionCheckMultiplier();
> assert multiplier > 0;
> if (iteration % multiplier != 0) continue;
> if (s.needsCompaction()) {
> // Queue a compaction. Will recognize if major is needed.
> this.instance.compactSplitThread.requestSystemCompaction(r, s, getName()
> + " requests compaction");
> } else if (s.isMajorCompaction()) {
> if (majorCompactPriority == DEFAULT_PRIORITY
> || majorCompactPriority > ((HRegion)r).getCompactPriority()) {
> this.instance.compactSplitThread.requestCompaction(r, s, getName()
> + " requests major compaction; use default priority", null);
> } else {
> this.instance.compactSplitThread.requestCompaction(r, s, getName()
> + " requests major compaction; use configured priority",
> this.majorCompactPriority, null, null);
> }
> }
> } catch (IOException e) {
> LOG.warn("Failed major compaction check on " + r, e);
> }
> }
> }
> iteration = (iteration == Long.MAX_VALUE) ? 0 : (iteration + 1);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)