Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
f5e56376
O
oceanbase
项目概览
大炮V587
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f5e56376
编写于
3月 07, 2023
作者:
O
obdev
提交者:
ob-robot
3月 07, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove monitor tenant and deny user to create tenant named diag
上级
31c95574
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
7 addition
and
22 deletion
+7
-22
deps/oblib/src/lib/ob_define.h
deps/oblib/src/lib/ob_define.h
+2
-2
src/observer/mysql/obmp_connect.cpp
src/observer/mysql/obmp_connect.cpp
+1
-13
src/observer/omt/ob_multi_tenant.cpp
src/observer/omt/ob_multi_tenant.cpp
+0
-6
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+4
-0
src/rootserver/ob_root_service.cpp
src/rootserver/ob_root_service.cpp
+0
-1
未找到文件。
deps/oblib/src/lib/ob_define.h
浏览文件 @
f5e56376
...
...
@@ -781,7 +781,7 @@ const char *const OB_FAKE_TENANT_NAME = "fake_tenant";
const
char
*
const
OB_GTS_TENANT_NAME
=
"gts"
;
const
char
*
const
OB_SYS_HOST_NAME
=
"%"
;
const
char
*
const
OB_DEFAULT_HOST_NAME
=
"%"
;
const
char
*
const
OB_MONITOR_TENANT_NAME
=
"monitor"
;
//
const char *const OB_MONITOR_TENANT_NAME = "monitor";
const
char
*
const
OB_DIAG_TENANT_NAME
=
"diag"
;
//for sync ddl (ClusterID_TenantID_SchemaVersion)
const
char
*
const
OB_DDL_ID_VAR_NAME
=
"__oceanbase_ddl_id"
;
...
...
@@ -819,7 +819,7 @@ const uint64_t OB_GTS_TENANT_ID = 2;
const
uint64_t
OB_SERVER_TENANT_ID
=
500
;
const
uint64_t
OB_ELECT_TENANT_ID
=
501
;
const
uint64_t
OB_EXT_LOG_TENANT_ID
=
506
;
const
uint64_t
OB_MONITOR_TENANT_ID
=
507
;
//
const uint64_t OB_MONITOR_TENANT_ID = 507;
const
uint64_t
OB_DTL_TENANT_ID
=
508
;
const
uint64_t
OB_DATA_TENANT_ID
=
509
;
const
uint64_t
OB_RS_TENANT_ID
=
510
;
...
...
src/observer/mysql/obmp_connect.cpp
浏览文件 @
f5e56376
...
...
@@ -1760,13 +1760,6 @@ int ObMPConnect::verify_connection(const uint64_t tenant_id) const
||
!
ipv6_local
.
set_ip_addr
(
IPV6_LOCAL_STR
,
FAKE_PORT
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"set ObAddr failed"
,
K
(
ret
),
K
(
IPV4_LOCAL_STR
),
K
(
IPV6_LOCAL_STR
),
K
(
FAKE_PORT
));
}
else
if
(
OB_MONITOR_TENANT_ID
==
conn
->
tenant_id_
)
{
if
(
!
(
get_peer
().
is_equal_except_port
(
ipv4_local
)
||
get_peer
().
is_equal_except_port
(
ipv6_local
)
||
get_peer
().
is_equal_except_port
(
GCTX
.
self_addr
())))
{
ret
=
OB_ERR_NO_PRIVILEGE
;
LOG_WARN
(
"The monitor isn't allowed to login by remote client"
,
K
(
get_peer
()),
K
(
ret
));
}
}
else
if
(
OB_DIAG_TENANT_ID
==
conn
->
tenant_id_
)
{
if
(
!
(
get_peer
().
is_equal_except_port
(
ipv4_local
)
||
get_peer
().
is_equal_except_port
(
ipv6_local
)
...
...
@@ -1829,12 +1822,7 @@ int ObMPConnect::verify_connection(const uint64_t tenant_id) const
int
ObMPConnect
::
check_update_tenant_id
(
ObSMConnection
&
conn
,
uint64_t
&
tenant_id
)
{
int
ret
=
OB_SUCCESS
;
if
(
tenant_name_
.
case_compare
(
OB_MONITOR_TENANT_NAME
)
==
0
)
{
tenant_name_
=
ObString
::
make_string
(
OB_SYS_TENANT_NAME
);
tenant_id
=
OB_SYS_TENANT_ID
;
conn
.
tenant_id_
=
tenant_id
;
conn
.
resource_group_id_
=
OB_MONITOR_TENANT_ID
;
}
else
if
(
tenant_name_
.
case_compare
(
OB_DIAG_TENANT_NAME
)
==
0
)
{
if
(
tenant_name_
.
case_compare
(
OB_DIAG_TENANT_NAME
)
==
0
)
{
tenant_name_
=
user_name_
;
user_name_
=
ObString
::
make_string
(
"root"
);
if
(
OB_FAIL
(
get_tenant_id
(
tenant_id
)))
{
...
...
src/observer/omt/ob_multi_tenant.cpp
浏览文件 @
f5e56376
...
...
@@ -630,12 +630,6 @@ int ObMultiTenant::create_virtual_tenants()
EXT_LOG_TENANT_CPU
)))
{
LOG_ERROR
(
"add ext_log tenant fail"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
create_tenant_without_unit
(
OB_MONITOR_TENANT_ID
,
OB_MONITOR_CPU
,
OB_MONITOR_CPU
)))
{
LOG_ERROR
(
"add monitor tenant fail"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
create_tenant_without_unit
(
OB_DATA_TENANT_ID
,
OB_DATA_CPU
,
...
...
src/rootserver/ob_ddl_service.cpp
浏览文件 @
f5e56376
...
...
@@ -20085,6 +20085,10 @@ int ObDDLService::create_tenant(
LOG_USER_ERROR(OB_MISS_ARGUMENT, "resource_pool_list");
}
LOG_WARN("missing arg to create tenant", KR(ret), K(arg));
} else if (tenant_name.case_compare(OB_DIAG_TENANT_NAME) == 0) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("tenant_name \'diag\' is reserved for diagnose tenant", KR(ret), K(arg));
LOG_USER_ERROR(OB_INVALID_ARGUMENT, "tenant_name (\'diag\' is reserved for diagnose tenant)");
} else if (GCONF.in_upgrade_mode()) {
ret = OB_OP_NOT_ALLOW;
LOG_WARN("create tenant when cluster is upgrading not allowed", K(ret));
src/rootserver/ob_root_service.cpp
浏览文件 @
f5e56376
...
...
@@ -5865,7 +5865,6 @@ int ObRootService::drop_user_defined_function(const obrpc::ObDropUserDefinedFunc
bool
ObRootService
::
is_sys_tenant
(
const
ObString
&
tenant_name
)
{
return
(
0
==
tenant_name
.
case_compare
(
OB_SYS_TENANT_NAME
)
||
0
==
tenant_name
.
case_compare
(
OB_MONITOR_TENANT_NAME
)
||
0
==
tenant_name
.
case_compare
(
OB_DIAG_TENANT_NAME
)
||
0
==
tenant_name
.
case_compare
(
OB_GTS_TENANT_NAME
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录