Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
89143de5
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
89143de5
编写于
10月 19, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grant check time
上级
26934679
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
6 addition
and
21 deletion
+6
-21
src/mnode/src/mnodeDb.c
src/mnode/src/mnodeDb.c
+0
-2
src/mnode/src/mnodeDnode.c
src/mnode/src/mnodeDnode.c
+0
-2
src/mnode/src/mnodeFunc.c
src/mnode/src/mnodeFunc.c
+0
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-3
src/mnode/src/mnodeUser.c
src/mnode/src/mnodeUser.c
+0
-2
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+5
-10
未找到文件。
src/mnode/src/mnodeDb.c
浏览文件 @
89143de5
...
...
@@ -429,10 +429,8 @@ static int32_t mnodeCreateDb(SAcctObj *pAcct, SCreateDbMsg *pCreate, SMnodeMsg *
}
}
#ifdef GRANT_CHECK_WRITE
code
=
grantCheck
(
TSDB_GRANT_DB
);
if
(
code
!=
0
)
return
code
;
#endif
pDb
=
calloc
(
1
,
sizeof
(
SDbObj
));
tstrncpy
(
pDb
->
name
,
pCreate
->
db
,
sizeof
(
pDb
->
name
));
...
...
src/mnode/src/mnodeDnode.c
浏览文件 @
89143de5
...
...
@@ -663,12 +663,10 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
}
static
int32_t
mnodeCreateDnode
(
char
*
ep
,
SMnodeMsg
*
pMsg
)
{
#ifndef GRANT_CHECK_WRITE
int32_t
grantCode
=
grantCheck
(
TSDB_GRANT_DNODE
);
if
(
grantCode
!=
TSDB_CODE_SUCCESS
)
{
return
grantCode
;
}
#endif
char
dnodeEp
[
TSDB_EP_LEN
]
=
{
0
};
tstrncpy
(
dnodeEp
,
ep
,
TSDB_EP_LEN
);
strtrim
(
dnodeEp
);
...
...
src/mnode/src/mnodeFunc.c
浏览文件 @
89143de5
...
...
@@ -205,12 +205,10 @@ int32_t mnodeCreateFunc(SAcctObj *pAcct, char *name, int32_t codeLen, char *code
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
#ifdef GRANT_CHECK_WRITE
code
=
grantCheck
(
TSDB_GRANT_USER
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
#endif
if
(
name
[
0
]
==
0
)
{
return
TSDB_CODE_MND_INVALID_FUNC_NAME
;
}
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
89143de5
...
...
@@ -2216,20 +2216,18 @@ static int32_t mnodeProcessCreateChildTableMsg(SMnodeMsg *pMsg) {
//SCMCreateTableMsg* p1 = pMsg->rpcMsg.pCont; // there are several tables here.
SCreateTableMsg
*
pCreate
=
(
SCreateTableMsg
*
)((
char
*
)
pMsg
->
rpcMsg
.
pCont
+
sizeof
(
SCMCreateTableMsg
));
#ifdef GRANT_CHECK_WRITE
int32_t
code
=
grantCheck
(
TSDB_GRANT_TIMESERIES
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mError
(
"msg:%p, app:%p table:%s, failed to create, grant timeseries failed"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
);
return
code
;
}
#endif
if
(
pMsg
->
retry
==
0
)
{
if
(
pMsg
->
pTable
==
NULL
)
{
SVgObj
*
pVgroup
=
NULL
;
int32_t
tid
=
0
;
int32_t
code
=
mnodeGetAvailableVgroup
(
pMsg
,
&
pVgroup
,
&
tid
);
code
=
mnodeGetAvailableVgroup
(
pMsg
,
&
pVgroup
,
&
tid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mDebug
(
"msg:%p, app:%p table:%s, failed to get available vgroup, reason:%s"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableName
,
tstrerror
(
code
));
...
...
src/mnode/src/mnodeUser.c
浏览文件 @
89143de5
...
...
@@ -250,12 +250,10 @@ int32_t mnodeCreateUser(SAcctObj *pAcct, char *name, char *pass, void *pMsg) {
return
TSDB_CODE_MND_USER_ALREADY_EXIST
;
}
#ifdef GRANT_CHECK_WRITE
code
=
grantCheck
(
TSDB_GRANT_USER
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
#endif
pUser
=
calloc
(
1
,
sizeof
(
SUserObj
));
tstrncpy
(
pUser
->
user
,
name
,
TSDB_USER_LEN
);
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
89143de5
...
...
@@ -56,6 +56,11 @@ int32_t vnodeProcessRead(void *vparam, SVReadMsg *pRead) {
}
static
int32_t
vnodeCheckRead
(
SVnodeObj
*
pVnode
)
{
if
(
grantCheck
(
TSDB_GRANT_TIME
)
!=
TSDB_CODE_SUCCESS
)
{
vDebug
(
"vgId:%d, grant expired, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
pVnode
);
return
TSDB_CODE_GRANT_EXPIRED
;
}
if
(
!
vnodeInReadyStatus
(
pVnode
))
{
vDebug
(
"vgId:%d, vnode status is %s, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
vnodeStatus
[
pVnode
->
status
],
pVnode
->
refCount
,
pVnode
);
...
...
@@ -228,16 +233,6 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pRead) {
vError
(
"error rpc msg in query, %s"
,
tstrerror
(
pRead
->
code
));
}
if
(
grantCheck
(
TSDB_GRANT_TIME
)
!=
TSDB_CODE_SUCCESS
)
{
SQueryTableRsp
*
pRsp
=
(
SQueryTableRsp
*
)
rpcMallocCont
(
sizeof
(
SQueryTableRsp
));
pRsp
->
code
=
TSDB_CODE_GRANT_EXPIRED
;
pRsp
->
qId
=
0
;
pRet
->
len
=
sizeof
(
SQueryTableRsp
);
pRet
->
rsp
=
pRsp
;
return
pRsp
->
code
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
void
**
handle
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录