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

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

View File

@ -320,6 +320,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).
@ -336,12 +337,13 @@ final class RSGroupInfoManagerImpl implements RSGroupInfoManager {
}
}
dst.addServer(el);
movedServers.add(el);
}
Map<String, RSGroupInfo> newGroupMap = Maps.newHashMap(holder.groupName2Group);
newGroupMap.put(src.getName(), src);
newGroupMap.put(dst.getName(), dst);
flushConfig(newGroupMap);
return dst.getServers();
return movedServers;
}
@Override