This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new 2c9d7fde54c HBASE-27920 Skipping compact for this region if the table 
disable compaction (#5273)
2c9d7fde54c is described below

commit 2c9d7fde54ce83bf3c3365ca448b2f3298c32129
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)
---
 .../java/org/apache/hadoop/hbase/regionserver/HRegionServer.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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 1c5940ca9ae..f9f84118106 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
@@ -1638,8 +1638,9 @@ public class HRegionServer extends 
HBaseServerBase<RSRpcServices>
     @Override
     protected void chore() {
       for (Region r : this.instance.onlineRegions.values()) {
-        // Skip compaction if region is read only
-        if (r == null || r.isReadOnly()) {
+        // 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;
         }
 

Reply via email to