From 3da23c22c5673825bdae6e12adbb5c8b31537f47 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 1 Feb 2022 15:38:23 -0800 Subject: [PATCH] HBASE-26726 Allow disable of region warmup before graceful move (#4085) Signed-off-by: Viraj Jasani --- .../org/apache/hadoop/hbase/master/HMaster.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 2266edaf17ad..8dd49ff4d04f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -435,6 +435,9 @@ public class HMaster extends HBaseServerBase implements Maste // Cached clusterId on stand by masters to serve clusterID requests from clients. private final CachedClusterId cachedClusterId; + public static final String WARMUP_BEFORE_MOVE = "hbase.master.warmup.before.move"; + private static final boolean DEFAULT_WARMUP_BEFORE_MOVE = true; + /** * Initializes the HMaster. The steps are as follows: *

@@ -2196,11 +2199,14 @@ public void move(final byte[] encodedRegionName, byte[] destServerName) throws I TransitRegionStateProcedure proc = this.assignmentManager.createMoveRegionProcedure(rp.getRegionInfo(), rp.getDestination()); - // Warmup the region on the destination before initiating the move. - // A region server could reject the close request because it either does not - // have the specified region or the region is being split. - warmUpRegion(rp.getDestination(), hri); - + if (conf.getBoolean(WARMUP_BEFORE_MOVE, DEFAULT_WARMUP_BEFORE_MOVE)) { + // Warmup the region on the destination before initiating the move. + // A region server could reject the close request because it either does not + // have the specified region or the region is being split. + LOG.info(getClientIdAuditPrefix() + " move " + rp + ", warming up region on " + + rp.getDestination()); + warmUpRegion(rp.getDestination(), hri); + } LOG.info(getClientIdAuditPrefix() + " move " + rp + ", running balancer"); Future future = ProcedureSyncWait.submitProcedure(this.procedureExecutor, proc); try {