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

Lars Hofhansl commented on HBASE-10273:
---------------------------------------

Do we need the warning here:
{code}
+              if (sn == null) {
+                LOG.warn("No region server for " + region);
{code}

Could serverRegions be null?
{code}
+                Set<HRegionInfo> serverRegions = this.servers.get(sn);
+                if (!serverRegions.remove(region)) {
+                  LOG.warn("No " + region + " on " + sn);
{code}

I guess, I'd prefer:
{code}
-              this.regions.remove(region);
+              ServerName sn = this.regions.remove(region);
+              if (sn != null) {
+                Set<HRegionInfo> serverRegions = this.servers.get(sn);
+                if (serverRegions == null || !serverRegions.remove(region)) {
+                  LOG.warn("No " + region + " on " + sn);
+                }
+              }
{code}


> AssignmentManager.regions(region to regionserver assignment map) and 
> AssignmentManager.servers(regionserver to regions assignment map) are not 
> always updated in tandem with each other
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-10273
>                 URL: https://issues.apache.org/jira/browse/HBASE-10273
>             Project: HBase
>          Issue Type: Bug
>          Components: master
>    Affects Versions: 0.94.16
>            Reporter: Feng Honghua
>            Assignee: Feng Honghua
>             Fix For: 0.94.16
>
>         Attachments: HBASE-10273-0.94_v0.patch
>
>
> By definition, AssignmentManager.servers and AssignmentManager.regions are 
> tied and should be updated in tandem with each other under a lock on 
> AssignmentManager.regions, but there are two places where this protocol is 
> broken.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to