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

ramkrishna.s.vasudevan commented on HBASE-4153:
-----------------------------------------------

Throwing exception when we get RegionalreadyInTransition is fine but there are 
2 problems
-> If we try HBaseAdmin.move() or HBaseAdmin.unassign() the ClosedRegionHandler 
will call assign() and in this flow if we throw
RegionAlreadyInTransitionException is thrown then we cannot bring the exception 
upto the user as EventHandler.run() catches the exception
So only for HBaseAdmin.assign() we can get the exception propogated upto the 
user.

-> If we make the assign() to throw exception then we need to handle it in many 
places.

So i have just returned once we get RegionalreadyInTransition Exception.

Another interesting thing observed was current in RegionalreadyInTransition.java
{code}
public RegionAlreadyInTransitionException(String action, String region) {
}
{code}
we were passing 2 args.  Now in the master if i had to decode this exception 
and unwrap the exception I was not able
to do so because
{code}
private IOException instantiateException(Class<? extends IOException> cls)
     throws Exception {
   Constructor<? extends IOException> cn = cls.getConstructor(String.class);
{code}
This is what we are expecting a single arg String constructor in 
RemoteException.java.  Hence i have done one modification of
passing the exact exception msg in the OpenRegionHandler and CloseRegionHandler

and just
{code}
public RegionAlreadyInTransitionException(String action) {
super(s);
}
{code}

> Handle RegionAlreadyInTransitionException in AssignmentManager
> --------------------------------------------------------------
>
>                 Key: HBASE-4153
>                 URL: https://issues.apache.org/jira/browse/HBASE-4153
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 0.92.0
>            Reporter: Jean-Daniel Cryans
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4153_1.patch
>
>
> Comment from Stack over in HBASE-3741:
> {quote}
> Question: Looking at this patch again, if we throw a 
> RegionAlreadyInTransitionException, won't we just assign the region elsewhere 
> though RegionAlreadyInTransitionException in at least one case here is saying 
> that the region is already open on this regionserver?
> {quote}
> Indeed looking at the code it's going to be handled the same way other 
> exceptions are. Need to add special cases for assign and unassign.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to