HBASE-25330 RSGroupInfoManagerImpl#moveServers return is not set of servers moved (#2719)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Baiqiang Zhao 2020-11-30 11:40:51 +08:00 committed by GitHub
parent 85bf542a44
commit e927fe88fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -244,6 +244,7 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager {
String dstGroup) throws IOException {
RSGroupInfo src = getRSGroupInfo(srcGroup);
RSGroupInfo dst = getRSGroupInfo(dstGroup);
Set<Address> movedServers = new HashSet<>();
// If destination is 'default' rsgroup, only add servers that are online. If not online, drop
// it. If not 'default' group, add server to 'dst' rsgroup EVEN IF IT IS NOT online (could be a
// rsgroup of dead servers that are to come back later).
@ -261,12 +262,13 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager {
}
}
dst.addServer(el);
movedServers.add(el);
}
Map<String, RSGroupInfo> newGroupMap = Maps.newHashMap(rsGroupMap);
newGroupMap.put(src.getName(), src);
newGroupMap.put(dst.getName(), dst);
flushConfig(newGroupMap);
return dst.getServers();
return movedServers;
}
@Override