This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch branch-2.5 in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push: new 0d8c1609b7b HBASE-27920 Skipping compact for this region if the table disable compaction (#5273) 0d8c1609b7b is described below commit 0d8c1609b7bd29a198f486099eedd08cff45b6fc Author: guluo <lupeng_n...@qq.com> AuthorDate: Thu Jul 6 10:19:32 2023 +0800 HBASE-27920 Skipping compact for this region if the table disable compaction (#5273) Signed-off-by: Duo Zhang <zhang...@apache.org> Signed-off-by: Wellington Chevreuil <wchevre...@apache.org> (cherry picked from commit d1f29d06ece649c32caa2ae5551e9a67a540014a) --- .../main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 7bf543927ad..c33997c19b6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -1920,7 +1920,9 @@ public class HRegionServer extends Thread @Override protected void chore() { for (Region r : this.instance.onlineRegions.values()) { - if (r == null) { + // If region is read only or compaction is disabled at table level, there's no need to + // iterate through region's stores + if (r == null || r.isReadOnly() || !r.getTableDescriptor().isCompactionEnabled()) { continue; } HRegion hr = (HRegion) r;