3131import org .apache .hadoop .hbase .client .RetriesExhaustedException ;
3232import org .apache .hadoop .hbase .master .MetricsAssignmentManager ;
3333import org .apache .hadoop .hbase .master .RegionState .State ;
34- import org .apache .hadoop .hbase .master .ServerManager ;
3534import org .apache .hadoop .hbase .master .procedure .AbstractStateMachineRegionProcedure ;
3635import org .apache .hadoop .hbase .master .procedure .MasterProcedureEnv ;
3736import org .apache .hadoop .hbase .master .procedure .ServerCrashProcedure ;
@@ -108,20 +107,6 @@ public class TransitRegionStateProcedure
108107
109108 private static final Logger LOG = LoggerFactory .getLogger (TransitRegionStateProcedure .class );
110109
111- public static final String FORCE_REGION_RETAINMENT = "hbase.master.scp.retain.assignment.force" ;
112-
113- public static final boolean DEFAULT_FORCE_REGION_RETAINMENT = false ;
114-
115- public static final String FORCE_REGION_RETAINMENT_WAIT =
116- "hbase.master.scp.retain.assignment.force.wait" ;
117-
118- public static final long DEFAULT_FORCE_REGION_RETAINMENT_WAIT = 500 ;
119-
120- public static final String FORCE_REGION_RETAINMENT_RETRIES =
121- "hbase.master.scp.retain.assignment.force.retries" ;
122-
123- public static final long DEFAULT_FORCE_REGION_RETAINMENT_RETRIES = 600 ;
124-
125110 private TransitionType type ;
126111
127112 private RegionStateTransitionState initialState ;
@@ -141,14 +126,6 @@ public class TransitRegionStateProcedure
141126
142127 private boolean isSplit ;
143128
144- private boolean forceRegionRetainment ;
145-
146- private ServerManager serverManager ;
147-
148- private long forceRegionRetainmentWait ;
149-
150- private long forceRegionRetainmentRetries ;
151-
152129 public TransitRegionStateProcedure () {
153130 }
154131
@@ -186,17 +163,6 @@ protected TransitRegionStateProcedure(MasterProcedureEnv env, RegionInfo hri,
186163 }
187164 evictCache =
188165 env .getMasterConfiguration ().getBoolean (EVICT_BLOCKS_ON_CLOSE_KEY , DEFAULT_EVICT_ON_CLOSE );
189-
190- forceRegionRetainment = env .getMasterConfiguration ().getBoolean (FORCE_REGION_RETAINMENT ,
191- DEFAULT_FORCE_REGION_RETAINMENT );
192-
193- forceRegionRetainmentWait = env .getMasterConfiguration ().getLong (FORCE_REGION_RETAINMENT_WAIT ,
194- DEFAULT_FORCE_REGION_RETAINMENT_WAIT );
195-
196- forceRegionRetainmentRetries = env .getMasterConfiguration ()
197- .getLong (FORCE_REGION_RETAINMENT_RETRIES , DEFAULT_FORCE_REGION_RETAINMENT_RETRIES );
198-
199- serverManager = env .getMasterServices ().getServerManager ();
200166 }
201167
202168 protected TransitRegionStateProcedure (MasterProcedureEnv env , RegionInfo hri ,
@@ -222,25 +188,6 @@ protected boolean waitInitialized(MasterProcedureEnv env) {
222188 return am .waitMetaLoaded (this ) || am .waitMetaAssigned (this , getRegion ());
223189 }
224190
225- private void checkAndWaitForOriginalServer (ServerName lastHost )
226- throws ProcedureSuspendedException {
227- boolean isOnline = serverManager .findServerWithSameHostnamePortWithLock (lastHost ) != null ;
228- long retries = 0 ;
229- while (!isOnline && retries < forceRegionRetainmentRetries ) {
230- try {
231- Thread .sleep (forceRegionRetainmentWait );
232- } catch (InterruptedException e ) {
233- throw new ProcedureSuspendedException ();
234- }
235- retries ++;
236- isOnline = serverManager .findServerWithSameHostnamePortWithLock (lastHost ) != null ;
237- }
238- LOG .info (
239- "{} is true. We waited {} ms for host {} to come back online. "
240- + "Did host come back online? {}" ,
241- FORCE_REGION_RETAINMENT , (retries * forceRegionRetainmentRetries ), lastHost , isOnline );
242- }
243-
244191 private void queueAssign (MasterProcedureEnv env , RegionStateNode regionNode )
245192 throws ProcedureSuspendedException {
246193 boolean retain = false ;
@@ -253,15 +200,9 @@ private void queueAssign(MasterProcedureEnv env, RegionStateNode regionNode)
253200 regionNode .setRegionLocation (assignCandidate );
254201 } else if (regionNode .getLastHost () != null ) {
255202 retain = true ;
256- LOG .info ("Setting lastHost {} as the location for region {}" , regionNode .getLastHost (),
257- regionNode .getRegionInfo ().getEncodedName ());
203+ LOG .info ("Setting lastHost as the region location {}" , regionNode .getLastHost ());
258204 regionNode .setRegionLocation (regionNode .getLastHost ());
259205 }
260- if (regionNode .getRegionLocation () != null && forceRegionRetainment ) {
261- LOG .warn ("{} is set to true. This may delay regions re-assignment "
262- + "upon RegionServers crashes or restarts." , FORCE_REGION_RETAINMENT );
263- checkAndWaitForOriginalServer (regionNode .getRegionLocation ());
264- }
265206 }
266207 LOG .info ("Starting {}; {}; forceNewPlan={}, retain={}" , this , regionNode .toShortString (),
267208 forceNewPlan , retain );
0 commit comments