[ https://issues.apache.org/jira/browse/HBASE-4273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092777#comment-13092777 ]
ramkrishna.s.vasudevan commented on HBASE-4273: ----------------------------------------------- Prior to HBASE-4052 {code} if (regionLocation == null) { // Region not being served, add to region map with no assignment // If this needs to be assigned out, it will also be in ZK as RIT this.regions.put(regionInfo, null); {code} We now try to add all those regions which were enabled (normal flow as previous) and the ones in DISABLING state. Hence the check has been modified {code} if (false == checkIfRegionBelongsToDisabled(regionInfo) && false == checkIfRegionsBelongsToEnabling(regionInfo)) { regions.put(regionInfo, regionLocation); } {code} But still the regionLocation null check is the existing code. When i fixed the bug was not sure when we may get null. @MingMa Could you dig in more as why the regionLocation was null? > java.lang.NullPointerException when a table is being disabled and HMaster > restarts > ---------------------------------------------------------------------------------- > > Key: HBASE-4273 > URL: https://issues.apache.org/jira/browse/HBASE-4273 > Project: HBase > Issue Type: Bug > Reporter: Ming Ma > Assignee: Ming Ma > > This bug occurs in following scenario. > 1. For some reason, the regionLocation isn't set in .META. table for some > regions. Perhaps createTable didn't complete successfully. > 1. The table of those regions is being disabled. > 2. HMaster restarted. > 3. At HMaster startup, it tries to transition from disabling to disabled > state. It got the following exception. > java.lang.NullPointerException: Passed server is null > at > org.apache.hadoop.hbase.master.ServerManager.sendRegionClose(ServerManager. > java:581) > at > org.apache.hadoop.hbase.master.AssignmentManager.unassign(AssignmentManager > .java:1093) > at > org.apache.hadoop.hbase.master.AssignmentManager.unassign(AssignmentManager > .java:1040) > at > org.apache.hadoop.hbase.master.handler.DisableTableHandler$BulkDisabler$1.r > un(DisableTableHandler.java:132) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j > ava:886) > In AssignmentManager.rebuildUserRegions, it added such regions to its regions > list, > if (regionLocation == null) { > // Region not being served, add to region map with no assignment > // If this needs to be assigned out, it will also be in ZK as RIT > // add if the table is not in disabled and enabling state > if (false == checkIfRegionBelongsToDisabled(regionInfo) > && false == checkIfRegionsBelongsToEnabling(regionInfo)) { > regions.put(regionInfo, regionLocation); > } > Perhaps, it should be > if (regionLocation == null) { > // Region not being served, add to region map with no assignment > // If this needs to be assigned out, it will also be in ZK as RIT > // add if the table is not in disabled and enabling state > if (true == checkIfRegionBelongsToEnabled(regionInfo) { > regions.put(regionInfo, regionLocation); > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira