From af5624bb8e8dfae1f57fb83d658ee3f78ed9851d Mon Sep 17 00:00:00 2001 From: bsglz <18031031@qq.com> Date: Tue, 29 Mar 2022 10:05:24 +0800 Subject: [PATCH] =?UTF-8?q?HBASE-26885=20The=20TRSP=20should=20not=20go=20?= =?UTF-8?q?on=20when=20it=20get=20a=20bogus=20server=20name=E2=80=A6=20(#4?= =?UTF-8?q?276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HBASE-26885 The TRSP should not go on when it get a bogus server name from AM (cherry picked from commit 1efd8fe53c13cdbfde7cb3d0ff7ebea7b8b7d3bb) --- .../hbase/master/assignment/TransitRegionStateProcedure.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java index 8ca1ee482e81..d2001c62ad11 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hbase.master.assignment; +import static org.apache.hadoop.hbase.master.LoadBalancer.BOGUS_SERVER_NAME; + import edu.umd.cs.findbugs.annotations.Nullable; import java.io.IOException; import org.apache.hadoop.hbase.HBaseIOException; @@ -199,7 +201,7 @@ private void queueAssign(MasterProcedureEnv env, RegionStateNode regionNode) private void openRegion(MasterProcedureEnv env, RegionStateNode regionNode) throws IOException { ServerName loc = regionNode.getRegionLocation(); - if (loc == null) { + if (loc == null || BOGUS_SERVER_NAME.equals(loc)) { LOG.warn("No location specified for {}, jump back to state {} to get one", getRegion(), RegionStateTransitionState.REGION_STATE_TRANSITION_GET_ASSIGN_CANDIDATE); setNextState(RegionStateTransitionState.REGION_STATE_TRANSITION_GET_ASSIGN_CANDIDATE);