diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index 7cdee4fa7758..547477016882 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -525,7 +525,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 newGroupMap = Maps.newHashMap(); @@ -684,9 +685,15 @@ private List getOnlineRS() throws IOException { // Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs. private SortedSet
getDefaultServers() throws IOException { + return getDefaultServers(listRSGroups()); + } + + // Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs. + private SortedSet
getDefaultServers(List rsGroupInfoList) + throws IOException { // Build a list of servers in other groups than default group, from rsGroupMap Set
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()); }