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

Jean-Daniel Cryans commented on HBASE-4351:
-------------------------------------------

Well there's definitely something we need to do. For example the shell help 
says:

bq.  Pass 'true' to force the unassignment ('force' will clear all in-memory 
state in master before the reassign). 

This doesn't make sense since you can't wipe out the in-memory state, and then 
know where to unassign (you just wiped that). Maybe we could do something 
better since we're not going to send a close... like I mentioned, I have to 
hbck -fix to reassign the region after using this, maybe we could call assign 
in the unassign method when force=true?

I know it sounds dumb, but in the end that's what happens anyway when you 
unassign with force=false because when the master receives the notification 
that the region is closed then it reassigns it.

> If from Admin we try to unassign a region forcefully, though a valid region 
> name is given the master is not able to identify the region to unassign.
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-4351
>                 URL: https://issues.apache.org/jira/browse/HBASE-4351
>             Project: HBase
>          Issue Type: Bug
>         Environment: Linux
>            Reporter: ramkrishna.s.vasudevan
>            Assignee: ramkrishna.s.vasudevan
>
> The following is the problem
> Get the exact region name from UI and call
> HBaseAdmin.unassign(regionname, true).
> Here true is forceful option.
> As part of unassign api
> {code}
>   public void unassign(final byte [] regionName, final boolean force)
>   throws IOException {
>     Pair<HRegionInfo, HServerAddress> pair =
>       MetaReader.getRegion(this.catalogTracker, regionName);
>     if (pair == null) throw new 
> UnknownRegionException(Bytes.toStringBinary(regionName));
>     HRegionInfo hri = pair.getFirst();
>     if (force) this.assignmentManager.clearRegionFromTransition(hri);
>     this.assignmentManager.unassign(hri, force);
>   }
> {code}
> As part of clearRegionFromTransition()
> {code}
>     synchronized (this.regions) {
>       this.regions.remove(hri);
>       for (Set<HRegionInfo> regions : this.servers.values()) {
>         regions.remove(hri);
>       }
>     }
> {code}
> the region is also removed.  Hence when the master tries to identify the 
> region
> {code}
>       if (!regions.containsKey(region)) {
>         debugLog(region, "Attempted to unassign region " +
>           region.getRegionNameAsString() + " but it is not " +
>           "currently assigned anywhere");
>         return;
>       }
> {code}
> It is not able to identify the region.  It exists in trunk and 0.90.x also.

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

        

Reply via email to