[ 
https://issues.apache.org/jira/browse/HBASE-6881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13464305#comment-13464305
 ] 

stack commented on HBASE-6881:
------------------------------

Thanks for the explanation.

bq. For the removed code, it is not needed, because if 
regionAlreadyInTransition, we already transition the state to offline state in 
the exception handling part.

Is the above comment suppose to be relate to this code?

{code}
     if (!hijack && !state.isClosed() && !state.isOffline()) {
-      if (!regionAlreadyInTransitionException ) {
-        String msg = "Unexpected state : " + state + " .. Cannot transit it to 
OFFLINE.";
-        this.server.abort(msg, new IllegalStateException(msg));
-        return -1;
-      } else {
-        LOG.debug("Unexpected state : " + state
-            + " but retrying to assign because 
RegionAlreadyInTransitionException.");
-      }
+      String msg = "Unexpected state : " + state + " .. Cannot transit it to 
OFFLINE.";
+      this.server.abort(msg, new IllegalStateException(msg));
+      return -1;
     }
{code}

If so, I'm not sure I follow.  The above code is a change which has us abort 
always if state is not closed or offline.  The old code did that  EXCEPT in the 
case where regionAlreadyInTransitionException is set.  You've removed this 
latter special handling.

Or are you saying that there is no need for this special exception handling 
because we've successfully off-lined the region at #1498 in patched version up 
on RB at this line: {code}currentState = regionStates.updateRegionState({code}?

I buy the other comments.  I see how excluding a server could be a problem.  
This is a necessary fix.  I see that we preserve the basic idea of hbase-6384 
which is keep old plan if RegionAlreadyInTransition (and now too if server not 
ready).


                
> All regionservers are marked offline even there is still one up
> ---------------------------------------------------------------
>
>                 Key: HBASE-6881
>                 URL: https://issues.apache.org/jira/browse/HBASE-6881
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Jimmy Xiang
>            Assignee: Jimmy Xiang
>         Attachments: trunk-6881.patch
>
>
> {noformat}
> +        RegionPlan newPlan = plan;
> +        if (!regionAlreadyInTransitionException) {
> +          // Force a new plan and reassign. Will return null if no servers.
> +          newPlan = getRegionPlan(state, plan.getDestination(), true);
> +        }
> +        if (newPlan == null) {
>            this.timeoutMonitor.setAllRegionServersOffline(true);
>            LOG.warn("Unable to find a viable location to assign region " +
>              state.getRegion().getRegionNameAsString());
> {noformat}
> Here, when newPlan is null, plan.getDestination() could be up actually.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to