Skip to content

Commit 8dec49a

Browse files
arshadmohammadvirajjasani
authored andcommitted
HBASE-24675: On Master restart all servers are assigned to default rsgroup
Closes #2053 Signed-off-by: Viraj Jasani <vjasani@apache.org>
1 parent a7fb896 commit 8dec49a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ private synchronized void refresh(boolean forceOnline) throws IOException {
525525

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

530531
// populate the data
531532
HashMap<String, RSGroupInfo> newGroupMap = Maps.newHashMap();
@@ -684,9 +685,15 @@ private List<ServerName> getOnlineRS() throws IOException {
684685

685686
// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
686687
private SortedSet<Address> getDefaultServers() throws IOException {
688+
return getDefaultServers(listRSGroups());
689+
}
690+
691+
// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
692+
private SortedSet<Address> getDefaultServers(List<RSGroupInfo> rsGroupInfoList)
693+
throws IOException {
687694
// Build a list of servers in other groups than default group, from rsGroupMap
688695
Set<Address> serversInOtherGroup = new HashSet<>();
689-
for (RSGroupInfo group : listRSGroups() /* get from rsGroupMap */) {
696+
for (RSGroupInfo group : rsGroupInfoList) {
690697
if (!RSGroupInfo.DEFAULT_GROUP.equals(group.getName())) { // not default group
691698
serversInOtherGroup.addAll(group.getServers());
692699
}

0 commit comments

Comments
 (0)