HBASE-27362 CompactSplit.requestCompactionInternal may bypass compactionsEnabled check (#4768)
Co-authored-by: comnetwork <comnetwork@163.com> Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
fa3bd7feb9
commit
a26cbf1057
|
@ -315,12 +315,14 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati
|
|||
LOG.info("Re-Initializing compactions because user switched on compactions");
|
||||
reInitializeCompactionsExecutors();
|
||||
}
|
||||
} else {
|
||||
setCompactionsEnabled(onOrOff);
|
||||
return;
|
||||
}
|
||||
|
||||
setCompactionsEnabled(onOrOff);
|
||||
LOG.info("Interrupting running compactions because user switched off compactions");
|
||||
interrupt();
|
||||
}
|
||||
setCompactionsEnabled(onOrOff);
|
||||
}
|
||||
|
||||
private void requestCompactionInternal(HRegion region, String why, int priority,
|
||||
boolean selectNow, CompactionLifeCycleTracker tracker,
|
||||
|
@ -336,6 +338,11 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati
|
|||
protected void requestCompactionInternal(HRegion region, HStore store, String why, int priority,
|
||||
boolean selectNow, CompactionLifeCycleTracker tracker,
|
||||
CompactionCompleteTracker completeTracker, User user) throws IOException {
|
||||
if (!this.isCompactionsEnabled()) {
|
||||
LOG.info("Ignoring compaction request for " + region + ",because compaction is disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
this.server.isStopped() || (region.getTableDescriptor() != null
|
||||
&& !region.getTableDescriptor().isCompactionEnabled())
|
||||
|
|
Loading…
Reference in New Issue