From 5eda5fb9d7d7fd5ae77d862c2e1666787e72ead0 Mon Sep 17 00:00:00 2001 From: gjacoby Date: Mon, 17 Apr 2017 16:08:25 -0700 Subject: [PATCH] HBASE-17912 - Avoid major compactions on region server startup Signed-off-by: tedyu --- .../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 b3b5113e350..d14571b6e38 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 @@ -1628,7 +1628,9 @@ public class HRegionServer extends HasThread implements private final HRegionServer instance; private final int majorCompactPriority; private final static int DEFAULT_PRIORITY = Integer.MAX_VALUE; - private long iteration = 0; + //Iteration is 1-based rather than 0-based so we don't check for compaction + // immediately upon region server startup + private long iteration = 1; CompactionChecker(final HRegionServer h, final int sleepTime, final Stoppable stopper) {