diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java index 3cad93911378..9c931b509d26 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java @@ -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 newGroupMap = Maps.newHashMap(); @@ -726,9 +726,14 @@ private void updateCacheOfRSGroups(final Set currentGroups) { // Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs. private SortedSet
getDefaultServers() { + return getDefaultServers(listRSGroups()/* get from rsGroupMap */); + } + + // Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs. + private SortedSet
getDefaultServers(List rsGroupInfoList) { // 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()); }