Apache9 commented on code in PR #4945:
URL: https://github.com/apache/hbase/pull/4945#discussion_r1073213896
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java:
##########
@@ -188,6 +239,25 @@ protected boolean waitInitialized(MasterProcedureEnv env) {
return am.waitMetaLoaded(this) || am.waitMetaAssigned(this, getRegion());
}
+ private void checkAndWaitForOriginalServer(ServerName lastHost)
+ throws ProcedureSuspendedException {
+ ServerName newNameForServer =
serverManager.findServerWithSameHostnamePortWithLock(lastHost);
+ boolean isOnline =
serverManager.createDestinationServersList().contains(newNameForServer);
+ if (!isOnline && retries < forceRegionRetainmentRetries) {
+ retries++;
+ LOG.info("Suspending the TRSP PID={} because {} is true and previous
host {} "
+ + "for region is not yet online.", this.getProcId(),
FORCE_REGION_RETAINMENT, lastHost);
+ setTimeout(forceRegionRetainmentWait);
Review Comment:
So the `forceRegionRetainmentWait` here is interval? Not total time?
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java:
##########
@@ -126,6 +144,14 @@
private boolean isSplit;
+ private boolean forceRegionRetainment;
+
+ private ServerManager serverManager;
Review Comment:
When executing you will always have a MasterProcedureEnv...
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/TransitRegionStateProcedure.java:
##########
@@ -126,6 +144,14 @@
private boolean isSplit;
+ private boolean forceRegionRetainment;
Review Comment:
Looking at other configs in TRSP, I prefer we store these configs in
AssignmentManager, just like
```
private final boolean shouldAssignRegionsWithFavoredNodes;
private final int assignDispatchWaitQueueMaxSize;
private final int assignDispatchWaitMillis;
private final int assignMaxAttempts;
private final int assignRetryImmediatelyMaxAttempts;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]