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 apache#2053

Author: Mohammad Arshad
Reason: Bug
Ref: CDPD-15964

Signed-off-by: Viraj Jasani <[email protected]>

Change-Id: I895e3f52e8b1b2a5d5bf3955e0526a09ad2748d1
(cherry picked from commit a2c63df)
  • Loading branch information
arshadmohammad authored and robertkerek-cldr committed Sep 2, 2020
1 parent 34f3755 commit 0a4deb1
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ 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(), orphanTables));
groupList.add(
new RSGroupInfo(RSGroupInfo.DEFAULT_GROUP, getDefaultServers(groupList), orphanTables));

// populate the data
HashMap<String, RSGroupInfo> newGroupMap = Maps.newHashMap();
Expand Down Expand Up @@ -578,9 +579,15 @@ private List<ServerName> getOnlineRS() throws IOException {

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

// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
private SortedSet<Address> getDefaultServers(List<RSGroupInfo> rsGroupInfoList)
throws IOException {
// 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 0a4deb1

Please sign in to comment.