HBASE-24675: On Master restart all servers are assigned to default rsgroup
Closes #2053 Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
parent
6ae2fdd6b2
commit
1781185b7b
|
@ -591,7 +591,7 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager {
|
||||||
|
|
||||||
// This is added to the last of the list so it overwrites the 'default' rsgroup loaded
|
// This is added to the last of the list so it overwrites the 'default' rsgroup loaded
|
||||||
// from region group table or zk
|
// 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
|
// populate the data
|
||||||
HashMap<String, RSGroupInfo> newGroupMap = Maps.newHashMap();
|
HashMap<String, RSGroupInfo> newGroupMap = Maps.newHashMap();
|
||||||
|
@ -726,9 +726,14 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager {
|
||||||
|
|
||||||
// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
|
// Called by ServerEventsListenerThread. Presume it has lock on this manager when it runs.
|
||||||
private SortedSet<Address> getDefaultServers() {
|
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
|
// Build a list of servers in other groups than default group, from rsGroupMap
|
||||||
Set<Address> serversInOtherGroup = new HashSet<>();
|
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
|
if (!RSGroupInfo.DEFAULT_GROUP.equals(group.getName())) { // not default group
|
||||||
serversInOtherGroup.addAll(group.getServers());
|
serversInOtherGroup.addAll(group.getServers());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue