HBASE-20500 [rsgroup] should keep at least one server in default group

Signed-off-by: tedyu <yuzhihong@gmail.com>
Amending-Author: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Yechao Chen 2018-05-08 14:04:59 +08:00 committed by Andrew Purtell
parent 2d493556f3
commit 8e92b3f458
1 changed files with 6 additions and 2 deletions

View File

@ -139,8 +139,12 @@ public class RSGroupAdminServer implements RSGroupAdmin {
}
}
if(srcGrp.getServers().size() <= servers.size() &&
srcGrp.getTables().size() > 0) {
if (RSGroupInfo.DEFAULT_GROUP.equals(srcGrp.getName()) && srcGrp.getServers().size() <=
servers.size()) {
throw new ConstraintException("Should keep at least one server in 'default' RSGroup ");
}
if(srcGrp.getServers().size() <= servers.size() && srcGrp.getTables().size() > 0) {
throw new ConstraintException("Cannot leave a group "+srcGrp.getName()+
" that contains tables " +"without servers.");
}