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

Ted Yu commented on HBASE-4153:
-------------------------------

Currently regionsInTransitionInRS is a ConcurrentSkipListSet. It doesn't record 
whether the region transition was initiated by openRegion() or closeRegion().
I think we can use ConcurrentSkipListMap for regionsInTransitionInRS:
{code}
  private final Map<byte[], Boolean> regionsInTransitionInRS =
    new ConcurrentSkipListMap<byte [], Boolean>(Bytes.BYTES_COMPARATOR);
{code}

On a side note, I wonder why the check for regionsInTransitionInRS.contains() 
below is followed by LOG.warn() instead of by throwing exception:
{code}
  protected boolean closeRegion(HRegionInfo region, final boolean abort,
      final boolean zk) {
    if (this.regionsInTransitionInRS.contains(region.getEncodedNameAsBytes())) {
      LOG.warn("Received close for region we are already opening or closing; " +
          region.getEncodedName());
      return false;
    }
{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
>             Fix For: 0.92.0
>
>
> 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