[CP] add consumer group name check

This commit is contained in:
zhjc1124
2024-03-28 10:16:04 +00:00
committed by ob-robot
parent 123296d3fc
commit 01f456d73d
3 changed files with 26 additions and 0 deletions

View File

@ -133,6 +133,10 @@ int ObPlDBMSResourceManager::create_consumer_group(
LOG_WARN("name of consumer group cannot be null or empty", K(ret));
// consumer_group 肯定存在,所以可以 get_string 读取,
// COMMENT 是可选的可能为 null,所以传入 ObObj
} else if (!GCTX.cgroup_ctrl_->is_valid_group_name(consumer_group)) {
ret = OB_INVALID_ARGUMENT;
LOG_USER_ERROR(OB_INVALID_ARGUMENT, "invalid consumer group name");
LOG_WARN("invalid consumer group name", K(ret), K(consumer_group));
} else if (OB_FAIL(proxy.create_consumer_group(tenant_id, consumer_group, params.at(COMMENT)))) {
LOG_WARN("fail create consumer_group", K(tenant_id), K(consumer_group), K(ret));
}