[
https://issues.apache.org/jira/browse/HBASE-20741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16594102#comment-16594102
]
huaxiang sun commented on HBASE-20741:
--------------------------------------
[~ram_krish], it looks good to me. One quick question. For the following new
logic, if numServers is small, is it possible that it will not find one RS
which does not have a replica assigned?
{code}
OUTER : for (RegionInfo region : unassignedRegions) {
boolean assigned = false;
INNER : for (int j = 0; j < numServers; j++) { // try all servers one by
one
ServerName serverName = servers.get((j + serverIdx) % numServers);
if (!cluster.wouldLowerAvailability(region, serverName)) {
List<RegionInfo> serverRegions =
assignments.computeIfAbsent(serverName, k -> new ArrayList<>());
if (!RegionReplicaUtil.isDefaultReplica(region.getReplicaId())) {
// if the region is not a default replica
// check if the assignments map has the other replica region on
this server
for (RegionInfo hri : serverRegions) {
if (RegionReplicaUtil.isReplicasForSameRegion(region, hri)) {
if (LOG.isTraceEnabled()) {
LOG.trace("Skipping the server, " + serverName
+ " , got the same server for the region " + region);
}
// do not allow this case. The unassignedRegions we got because
the
// replica region in this list was not assigned because of
lower availablity issue.
// So when we assign here we should ensure that as far as
possible the server being
// selected does not have the server where the replica region
was not assigned.
continue INNER; // continue the inner loop, ie go to the next
server
}
}
}
{code}
> Split of a region with replicas creates all daughter regions and its replica
> in same server
> -------------------------------------------------------------------------------------------
>
> Key: HBASE-20741
> URL: https://issues.apache.org/jira/browse/HBASE-20741
> Project: HBase
> Issue Type: Bug
> Components: read replicas
> Affects Versions: 3.0.0, 2.0.0
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Priority: Major
> Fix For: 3.0.0, 2.2.0
>
> Attachments: HBASE-20741.patch, HBASE-20741_1.patch,
> HBASE-20741_2.patch, HBASE-20741_2.patch
>
>
> Generally it is better that the parent region when split creates the daughter
> region in the same target server.
> But for replicas also we do the same and all the replica regions are created
> in the same target server. We should ideally be doing a round robin and only
> the primary daughter region should be opened in the intended target server
> (where the parent was previously opened).
> [~huaxiang] FYI.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)