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

stack commented on HBASE-543:
-----------------------------

Patch passed with loading and start/stops of hbase.  Also passed unit tests.

Is this safe?
{code}
+        if (!master.regionManager.isUnassigned(i) &&
+            !master.regionManager.isAssigned(i.getRegionName()) &&
+            !master.regionManager.isPending(i.getRegionName())) {
+          master.regionManager.setUnassigned(i, false);
{code}
Should this all be done in a sync block inside in regionManager?  Or is it 
'safe' because we process one message at a time?  There are a few of these 
multiple tests.  This glob of checks is done in a few places.  Put them 
together in a single method?  Would be easier to read (Latter point is not 
important for now).

If above is safe, then I'm +1 on committing last version of this patch.   Can 
address other minor stuff later.



> A region's state is kept in several places in the master opening the 
> possibility for race conditions
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-543
>                 URL: https://issues.apache.org/jira/browse/HBASE-543
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: master
>    Affects Versions: 0.1.0, 0.1.1, 0.2.0
>            Reporter: Jim Kellerman
>            Assignee: Jim Kellerman
>             Fix For: 0.19.0
>
>         Attachments: 543.patch, 543.patch, 543.patch, recent-changes.patch, 
> regionstate.txt
>
>
> A region's state exists in multiple maps in the RegionManager: 
> unassignedRegions, pendingRegions, regionsToClose, closingRegions, 
> regionsToDelete, etc.
> One of these race conditions was found in HBASE-534.
> For HBase-0.1.x, we should just patch the holes we find.
> The ultimate solution (which requires a lot of changes in HMaster) should be 
> applied to HBase trunk.
> Proposed solution:
> Create a class that encapsulates a region's state and provide synchronized 
> access to the class that validates state changes.
> There should be a single structure that holds regions in these transitional 
> states and it should be a synchronized collection of some kind.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to