HBASE-24591 get_table_rsgroup ignored the existence of rsgroup config for namespace (#1925)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
f22c7a6583
commit
dfaba965c9
|
@ -2982,13 +2982,9 @@ public class MasterRpcServices extends RSRpcServices implements
|
|||
if (td == null) {
|
||||
resp = GetRSGroupInfoOfTableResponse.getDefaultInstance();
|
||||
} else {
|
||||
RSGroupInfo rsGroupInfo = null;
|
||||
if (td.getRegionServerGroup().isPresent()) {
|
||||
rsGroupInfo = master.getRSGroupInfoManager().getRSGroup(td.getRegionServerGroup().get());
|
||||
}
|
||||
if (rsGroupInfo == null) {
|
||||
rsGroupInfo = master.getRSGroupInfoManager().getRSGroup(RSGroupInfo.DEFAULT_GROUP);
|
||||
}
|
||||
RSGroupInfo rsGroupInfo =
|
||||
RSGroupUtil.getRSGroupInfo(master, master.getRSGroupInfoManager(), tableName)
|
||||
.orElse(master.getRSGroupInfoManager().getRSGroup(RSGroupInfo.DEFAULT_GROUP));
|
||||
resp = GetRSGroupInfoOfTableResponse.newBuilder()
|
||||
.setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(rsGroupInfo)).build();
|
||||
}
|
||||
|
|
|
@ -179,6 +179,28 @@ public class TestRSGroupsAdmin1 extends TestRSGroupsBase {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNamespaceConstraint2() throws Exception {
|
||||
String nsName = TABLE_PREFIX + name.getMethodName();
|
||||
String groupName = TABLE_PREFIX + name.getMethodName();
|
||||
TableName tableName = TableName.valueOf(nsName, name.getMethodName());
|
||||
addGroup(groupName, 1);
|
||||
|
||||
ADMIN.createNamespace(NamespaceDescriptor.create(nsName)
|
||||
.addConfiguration(RSGroupInfo.NAMESPACE_DESC_PROP_GROUP, groupName).build());
|
||||
|
||||
TEST_UTIL.createTable(tableName, "C");
|
||||
TEST_UTIL.waitTableAvailable(tableName);
|
||||
RSGroupInfo rsGroup = ADMIN.getRSGroup(tableName);
|
||||
assertEquals(groupName, rsGroup.getName());
|
||||
|
||||
TEST_UTIL.deleteTable(tableName);
|
||||
ADMIN.deleteNamespace(nsName);
|
||||
|
||||
ADMIN.moveServersToRSGroup(rsGroup.getServers(), RSGroupInfo.DEFAULT_GROUP);
|
||||
ADMIN.removeRSGroup(groupName);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailRemoveGroup() throws IOException, InterruptedException {
|
||||
int initNumGroups = ADMIN.listRSGroups().size();
|
||||
|
|
Loading…
Reference in New Issue