[ https://issues.apache.org/jira/browse/HBASE-18036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16008684#comment-16008684 ]
Stephen Yuan Jiang edited comment on HBASE-18036 at 5/12/17 9:01 PM: --------------------------------------------------------------------- The V1 patch has minor change based on [~elserj]'s feedback. Also add some logging to make the change clear. The V1 change was tested in a small cluster. I used Ambari to restart cluster and saw the new code path got hit and regions assigned back to its original region server and locality is preserved. Next up: I will use the same logic in branch-1 and other child branches. Base on [~devaraj]'s offline feedback, I will remove the newly introduced "hbase.master.retain.assignment" config in branch-1; but keep the config in other branches (this config is just for in case of regression, user has a way to revert back to original round robin behavior; as patch releases usually don't have full testing) was (Author: syuanjiang): The V1 patch has minor change based on [~elserj]'s feedback. Also add some logging to make the change clear. Next up: I will use the same logic in branch-1 and other child branches. Base on [~devaraj]'s offline feedback, I will remove the newly introduced "hbase.master.retain.assignment" config in branch-1; but keep the config in other branches (this config is just for in case of regression, user has a way to revert back to original round robin behavior; as patch releases usually don't have full testing) > Data locality is not maintained after cluster restart or SSH > ------------------------------------------------------------ > > Key: HBASE-18036 > URL: https://issues.apache.org/jira/browse/HBASE-18036 > Project: HBase > Issue Type: Bug > Components: Region Assignment > Affects Versions: 1.4.0, 1.3.1, 1.2.5, 1.1.10 > Reporter: Stephen Yuan Jiang > Assignee: Stephen Yuan Jiang > Attachments: HBASE-18036.v0-branch-1.1.patch, > HBASE-18036.v1-branch-1.1.patch > > > After HBASE-2896 / HBASE-4402, we think data locality is maintained after > cluster restart. However, we have seem some complains about data locality > loss when cluster restart (eg. HBASE-17963). > Examining the AssignmentManager#processDeadServersAndRegionsInTransition() > code, for cluster start, I expected to hit the following code path: > {code} > if (!failover) { > // Fresh cluster startup. > LOG.info("Clean cluster startup. Assigning user regions"); > assignAllUserRegions(allRegions); > } > {code} > where assignAllUserRegions would use retainAssignment() call in LoadBalancer; > however, from master log, we usually hit the failover code path: > {code} > // If we found user regions out on cluster, its a failover. > if (failover) { > LOG.info("Found regions out on cluster or in RIT; presuming failover"); > // Process list of dead servers and regions in RIT. > // See HBASE-4580 for more information. > processDeadServersAndRecoverLostRegions(deadServers); > } > {code} > where processDeadServersAndRecoverLostRegions() would put dead servers in SSH > and SSH uses roundRobinAssignment() in LoadBalancer. That is why we would > see loss locality more often than retaining locality during cluster restart. > Note: the code I was looking at is close to branch-1 and branch-1.1. -- This message was sent by Atlassian JIRA (v6.3.15#6346)