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

rajeshbabu commented on HBASE-6317:
-----------------------------------

Patch for 94.
As per the current code two scenarios may cause assignment incosistent.

1)in EnableTableHandler we dont assign regions if they are present in regions 
map.
{code}
    final List<HRegionInfo> onlineRegions =
      this.assignmentManager.getRegionsOfTable(tableName);
    regionsInMeta.removeAll(onlineRegions);
{code}
But in case of enabling table regions during master start up we are not adding 
them to regions map in rebuldUseRegions even the regions in/transition to 
onlineServers.
{code}
        if (false == checkIfRegionBelongsToDisabled(regionInfo)
            && false == checkIfRegionsBelongsToEnabling(regionInfo)) {
          synchronized (this.regions) {
            regions.put(regionInfo, regionLocation);
            addToServers(regionLocation, regionInfo);
          }
        }
{code}

So we will call assign to all the regions even they are in transition/already 
assigned  to online servers which may cause double assignment.

2) If all the tables are in ENABLING we may consider as clean cluster 
startup(because regions map is empty) and again call assignment for all the 
regions.(Which may again cause double assignment)

This patch solves these problems. Please review and provide comments or 
suggestions.
                
> Master clean start up and Partially enabled tables make region assignment 
> inconsistent.
> ---------------------------------------------------------------------------------------
>
>                 Key: HBASE-6317
>                 URL: https://issues.apache.org/jira/browse/HBASE-6317
>             Project: HBase
>          Issue Type: Bug
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 0.92.2, 0.96.0, 0.94.1
>
>         Attachments: HBASE-6317_94.patch
>
>
> If we have a  table in partially enabled state (ENABLING) then on HMaster 
> restart we treat it as a clean cluster start up and do a bulk assign.  
> Currently in 0.94 bulk assign will not handle ALREADY_OPENED scenarios and it 
> leads to region assignment problems.  Analysing more on this we found that we 
> have better way to handle these scenarios.
> {code}
> if (false == checkIfRegionBelongsToDisabled(regionInfo)
>             && false == checkIfRegionsBelongsToEnabling(regionInfo)) {
>           synchronized (this.regions) {
>             regions.put(regionInfo, regionLocation);
>             addToServers(regionLocation, regionInfo);
>           }
> {code}
> We dont add to regions map so that enable table handler can handle it.  But 
> as nothing is added to regions map we think it as a clean cluster start up.
> Will come up with a patch tomorrow.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to