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

zhou wenjian commented on HBASE-6391:
-------------------------------------

in HBASE-6317 
rajeshbabu  comments
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.
final List<HRegionInfo> onlineRegions 
=this.assignmentManager.getRegionsOfTable(tableName);
regionsInMeta.removeAll(onlineRegions);
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.
if (false == checkIfRegionBelongsToDisabled(regionInfo) && false == 
checkIfRegionsBelongsToEnabling(regionInfo)) {
          synchronized (this.regions) {
            regions.put(regionInfo, regionLocation);
            addToServers(regionLocation, regionInfo);
          }
        }
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)


if we romove the check for RegionsBelongsToEnabling, the first scenario will 
not happen again.
and for the other scenario we just need to worry about only one case.
that is ,all tables are enabling ,and none of the regions' location are 
registered in the meta.

                
> Master restart when enabling table will lead to region assignned twice
> ----------------------------------------------------------------------
>
>                 Key: HBASE-6391
>                 URL: https://issues.apache.org/jira/browse/HBASE-6391
>             Project: HBase
>          Issue Type: Bug
>          Components: master
>    Affects Versions: 0.94.0
>            Reporter: zhou wenjian
>             Fix For: 0.94.1
>
>
> The Scenario can be reproduce below.
> Enabling an table, some region is online on regionserver,some are still being 
> processed.
> And restart the master.
> when master failover:
>         // Region is being served and on an active server
>         // add only if region not in disabled and enabling table
>         if (false == checkIfRegionBelongsToDisabled(regionInfo)
>             && false == checkIfRegionsBelongsToEnabling(regionInfo)) {
>           regions.put(regionInfo, regionLocation);
>           addToServers(regionLocation, regionInfo);
>         }
> the opened region will not add to the Regions in master.
> and in the following recoverTableInEnablingState,the region will be assigned 
> again.
> that will lead to the cluster inconsistent

--
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