From daf6126a5dada7f139cb36980d007fd71cc078ee Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Mon, 31 Jan 2022 14:19:42 -0800 Subject: [PATCH] HBASE-26726 Allow disable of region warmup before graceful move --- .../org/apache/hadoop/hbase/master/HMaster.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 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 69db145b9957..7e2689554021 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 @@ -396,6 +396,9 @@ public void run() { // Waiting time of non-meta region's moving for meta regions assignment. private final long timeoutWaitMetaRegionAssignment; + public static final String WARMUP_BEFORE_MOVE = "hbase.master.warmup.before.move"; + private static final boolean DEFAULT_WARMUP_BEFORE_MOVE = true; + public static class RedirectServlet extends HttpServlet { private static final long serialVersionUID = 2894774810058302473L; private final int regionServerInfoPort; @@ -1846,10 +1849,15 @@ public void move(final byte[] encodedRegionName, return; } } - // warmup the region on the destination before initiating the move. this call - // is synchronous and takes some time. doing it before the source region gets - // closed - serverManager.sendRegionWarmup(rp.getDestination(), hri); + + if (conf.getBoolean(WARMUP_BEFORE_MOVE, DEFAULT_WARMUP_BEFORE_MOVE)) { + // warmup the region on the destination before initiating the move. this call + // is synchronous and takes some time. doing it before the source region gets + // closed + LOG.info(getClientIdAuditPrefix() + " move " + rp + ", warming up region on " + + rp.getDestination()); + serverManager.sendRegionWarmup(rp.getDestination(), hri); + } // Here wait until all the meta regions are not in transition. if (!hri.isMetaRegion() && assignmentManager.getRegionStates().isMetaRegionInTransition()) {