Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d5ee7efb
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
d5ee7efb
编写于
1月 25, 2022
作者:
S
Shengliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adjust log in dnd-transport
上级
0e2d0334
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
23 deletion
+23
-23
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+23
-23
未找到文件。
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
d5ee7efb
...
...
@@ -25,9 +25,9 @@
#include "dndMnode.h"
#include "dndVnodes.h"
#define INTERNAL_USER "_
internal
"
#define INTERNAL_USER "_
dnd
"
#define INTERNAL_CKEY "_key"
#define INTERNAL_SECRET "_
secret
"
#define INTERNAL_SECRET "_
pwd
"
static
void
dndInitMsgFp
(
STransMgmt
*
pMgmt
)
{
// Requests handled by DNODE
...
...
@@ -116,7 +116,7 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
// Requests handled by VNODE
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_SUBMIT
)]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_QUERY
)]
=
dndProcessVnodeQueryMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_QUERY_CONTINUE
)]
=
dndProcessVnodeQueryMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_QUERY_CONTINUE
)]
=
dndProcessVnodeQueryMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_FETCH
)]
=
dndProcessVnodeFetchMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_ALTER_TABLE
)]
=
dndProcessVnodeWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_UPDATE_TAG_VAL
)]
=
dndProcessVnodeWriteMsg
;
...
...
@@ -152,17 +152,18 @@ static void dndProcessResponse(void *parent, SRpcMsg *pRsp, SEpSet *pEpSet) {
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
if
(
pRsp
==
NULL
||
pRsp
->
pCont
==
NULL
)
return
;
dTrace
(
"RPC %p, rsp:%s i
s ignored since dnode is stopping"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
)
);
dTrace
(
"RPC %p, rsp:%s i
gnored since dnode exiting, app:%p"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
),
pRsp
->
ahandle
);
rpcFreeCont
(
pRsp
->
pCont
);
return
;
}
DndMsgFp
fp
=
pMgmt
->
msgFp
[
TMSG_INDEX
(
msgType
)];
if
(
fp
!=
NULL
)
{
dTrace
(
"RPC %p, rsp:%s will be processed, code:0x%x"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
),
pRsp
->
code
&
0XFFFF
);
dTrace
(
"RPC %p, rsp:%s will be processed, code:0x%x app:%p"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
),
pRsp
->
code
&
0XFFFF
,
pRsp
->
ahandle
);
(
*
fp
)(
pDnode
,
pRsp
,
pEpSet
);
}
else
{
dError
(
"RPC %p, rsp:%s not processed
"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
)
);
dError
(
"RPC %p, rsp:%s not processed
, app:%p"
,
pRsp
->
handle
,
TMSG_INFO
(
msgType
),
pRsp
->
ahandle
);
rpcFreeCont
(
pRsp
->
pCont
);
}
}
...
...
@@ -189,7 +190,7 @@ static int32_t dndInitClient(SDnode *pDnode) {
pMgmt
->
clientRpc
=
rpcOpen
(
&
rpcInit
);
if
(
pMgmt
->
clientRpc
==
NULL
)
{
dError
(
"failed to init rpc client"
);
dError
(
"failed to init
dnode
rpc client"
);
return
-
1
;
}
...
...
@@ -212,40 +213,39 @@ static void dndProcessRequest(void *param, SRpcMsg *pReq, SEpSet *pEpSet) {
tmsg_t
msgType
=
pReq
->
msgType
;
if
(
msgType
==
TDMT_DND_NETWORK_TEST
)
{
dTrace
(
"RPC %p, network test req
, app:%p will be processed, code:0x%x"
,
pReq
->
handle
,
pReq
->
ahandle
,
pReq
->
cod
e
);
dTrace
(
"RPC %p, network test req
will be processed, app:%p"
,
pReq
->
handle
,
pReq
->
ahandl
e
);
dndProcessStartupReq
(
pDnode
,
pReq
);
return
;
}
if
(
dndGetStat
(
pDnode
)
==
DND_STAT_STOPPED
)
{
dError
(
"RPC %p, req:%s
app:%p is ignored since dnode exiting
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_DND_OFFLINE
};
dError
(
"RPC %p, req:%s
ignored since dnode exiting, app:%p
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_DND_OFFLINE
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pReq
->
pCont
);
return
;
}
else
if
(
dndGetStat
(
pDnode
)
!=
DND_STAT_RUNNING
)
{
dError
(
"RPC %p, req:%s
app:%p is ignored since dnode not running
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_APP_NOT_READY
};
dError
(
"RPC %p, req:%s
ignored since dnode not running, app:%p
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_APP_NOT_READY
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pReq
->
pCont
);
return
;
}
if
(
pReq
->
pCont
==
NULL
)
{
dTrace
(
"RPC %p, req:%s app:%p not processed since content is null"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_DND_INVALID_MSG_LEN
};
dTrace
(
"RPC %p, req:%s not processed since its empty, app:%p"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_DND_INVALID_MSG_LEN
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
return
;
}
DndMsgFp
fp
=
pMgmt
->
msgFp
[
TMSG_INDEX
(
msgType
)];
if
(
fp
!=
NULL
)
{
dTrace
(
"RPC %p, req:%s
app:%p will be processed
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
dTrace
(
"RPC %p, req:%s
will be processed, app:%p
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
(
*
fp
)(
pDnode
,
pReq
,
pEpSet
);
}
else
{
dError
(
"RPC %p, req:%s
app:%p is not processed since no handle
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_MSG_NOT_PROCESSED
};
dError
(
"RPC %p, req:%s
not processed since no handle, app:%p
"
,
pReq
->
handle
,
TMSG_INFO
(
msgType
),
pReq
->
ahandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pReq
->
handle
,
.
code
=
TSDB_CODE_MSG_NOT_PROCESSED
,
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pReq
->
pCont
);
}
...
...
@@ -285,24 +285,24 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
SDnode
*
pDnode
=
parent
;
if
(
dndAuthInternalReq
(
parent
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
dTrace
(
"user:%s, get auth from
internal
mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
dTrace
(
"user:%s, get auth from mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
0
;
}
if
(
dndGetUserAuthFromMnode
(
pDnode
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
dTrace
(
"user:%s, get auth from
internal
mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
dTrace
(
"user:%s, get auth from mnode, spi:%d encrypt:%d"
,
user
,
*
spi
,
*
encrypt
);
return
0
;
}
if
(
terrno
!=
TSDB_CODE_APP_NOT_READY
)
{
dTrace
(
"failed to get user auth from
internal
mnode since %s"
,
terrstr
());
dTrace
(
"failed to get user auth from mnode since %s"
,
terrstr
());
return
-
1
;
}
SAuthReq
*
pReq
=
rpcMallocCont
(
sizeof
(
SAuthReq
));
tstrncpy
(
pReq
->
user
,
user
,
TSDB_USER_LEN
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
sizeof
(
SAuthReq
),
.
msgType
=
TDMT_MND_AUTH
};
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
sizeof
(
SAuthReq
),
.
msgType
=
TDMT_MND_AUTH
,
.
ahandle
=
(
void
*
)
9528
};
SRpcMsg
rpcRsp
=
{
0
};
dTrace
(
"user:%s, send user auth req to other mnodes, spi:%d encrypt:%d"
,
user
,
pReq
->
spi
,
pReq
->
encrypt
);
dndSendMsgToMnodeRecv
(
pDnode
,
&
rpcMsg
,
&
rpcRsp
);
...
...
@@ -346,7 +346,7 @@ static int32_t dndInitServer(SDnode *pDnode) {
pMgmt
->
serverRpc
=
rpcOpen
(
&
rpcInit
);
if
(
pMgmt
->
serverRpc
==
NULL
)
{
dError
(
"failed to init rpc server"
);
dError
(
"failed to init
dnode
rpc server"
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录