Skip to content

Commit

Permalink
HBASE-24675: On Master restart all servers are assigned to default rs…
Browse files Browse the repository at this point in the history
…group

Closes #2053

Signed-off-by: Viraj Jasani <[email protected]>
  • Loading branch information
arshadmohammad authored and virajjasani committed Jul 17, 2020
1 parent 6ae2fdd commit 1781185
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ private synchronized void refresh(boolean forceOnline) throws IOException {

// This is added to the last of the list so it overwrites the 'default' rsgroup loaded
// from region group table or zk
groupList.add(new RSGroupInfo(RSGroupInfo.DEFAULT_GROUP, getDefaultServers()));
groupList.add(new RSGroupInfo(RSGroupInfo.DEFAULT_GROUP, getDefaultServers(groupList)));

// populate the data
HashMap<String, RSGroupInfo> newGroupMap = Maps.newHashMap();
Expand Down Expand Up @@ -726,9 +726,14 @@ private void updateCacheOfRSGroups(final Set<String> currentGroups) {

// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
private SortedSet<Address> getDefaultServers() {
return getDefaultServers(listRSGroups()/* get from rsGroupMap */);
}

// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
private SortedSet<Address> getDefaultServers(List<RSGroupInfo> rsGroupInfoList) {
// Build a list of servers in other groups than default group, from rsGroupMap
Set<Address> serversInOtherGroup = new HashSet<>();
for (RSGroupInfo group : listRSGroups() /* get from rsGroupMap */) {
for (RSGroupInfo group : rsGroupInfoList) {
if (!RSGroupInfo.DEFAULT_GROUP.equals(group.getName())) { // not default group
serversInOtherGroup.addAll(group.getServers());
}
Expand Down

0 comments on commit 1781185

Please sign in to comment.