HBASE-27362 CompactSplit.requestCompactionInternal may bypass compactionsEnabled check (#4768)
Co-authored-by: comnetwork <comnetwork@163.com> Signed-off-by: Duo Zhang <zhangduo@apache.org> (cherry picked from commit a26cbf105743de28c62a6442eba2ef04d17d46af)
This commit is contained in:
parent
8b411e1451
commit
fa11c8024e
@ -315,11 +315,13 @@ public class CompactSplit implements CompactionRequester, PropagatingConfigurati
|
||||
LOG.info("Re-Initializing compactions because user switched on compactions");
|
||||
reInitializeCompactionsExecutors();
|
||||
}
|
||||
} else {
|
||||
LOG.info("Interrupting running compactions because user switched off compactions");
|
||||
interrupt();
|
||||
setCompactionsEnabled(onOrOff);
|
||||
return;
|
||||
}
|
||||
|
||||
setCompactionsEnabled(onOrOff);
|
||||
LOG.info("Interrupting running compactions because user switched off compactions");
|
||||
interrupt();
|
||||
}
|
||||
|
||||
private void requestCompactionInternal(HRegion region, String why, int priority,
|
||||
@ -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…
x
Reference in New Issue
Block a user