Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ad1609fe
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看板
提交
ad1609fe
编写于
3月 11, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
71258751
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
28 deletion
+48
-28
source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h
source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h
+1
-1
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
+2
-2
source/dnode/mgmt/impl/mnodeMgmt/src/mmWorker.c
source/dnode/mgmt/impl/mnodeMgmt/src/mmWorker.c
+43
-23
source/util/src/tprocess.c
source/util/src/tprocess.c
+2
-2
未找到文件。
source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h
浏览文件 @
ad1609fe
...
@@ -53,7 +53,7 @@ void mmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);
...
@@ -53,7 +53,7 @@ void mmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);
int32_t
mmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
void
mmConsumeChildQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
mmConsumeChildQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
mmConsumeParentQueue
(
SDnode
*
pDnode
,
S
Mnd
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
void
mmConsumeParentQueue
(
SDnode
*
pDnode
,
S
Rpc
Msg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c
浏览文件 @
ad1609fe
...
@@ -130,8 +130,8 @@ int32_t mmOpen(SDnode *pDnode, SMnodeOpt *pOption) {
...
@@ -130,8 +130,8 @@ int32_t mmOpen(SDnode *pDnode, SMnodeOpt *pOption) {
.
childFreeBodyFp
=
(
ProcFreeFp
)
rpcFreeCont
,
.
childFreeBodyFp
=
(
ProcFreeFp
)
rpcFreeCont
,
.
parentQueueSize
=
1024
*
1024
,
.
parentQueueSize
=
1024
*
1024
,
.
parentConsumeFp
=
(
ProcConsumeFp
)
mmConsumeParentQueue
,
.
parentConsumeFp
=
(
ProcConsumeFp
)
mmConsumeParentQueue
,
.
parentdMallocHeadFp
=
(
ProcMallocFp
)
taosAllocateQitem
,
.
parentdMallocHeadFp
=
(
ProcMallocFp
)
malloc
,
.
parentFreeHeadFp
=
(
ProcFreeFp
)
taosFreeQitem
,
.
parentFreeHeadFp
=
(
ProcFreeFp
)
free
,
.
parentMallocBodyFp
=
(
ProcMallocFp
)
rpcMallocCont
,
.
parentMallocBodyFp
=
(
ProcMallocFp
)
rpcMallocCont
,
.
parentFreeBodyFp
=
(
ProcFreeFp
)
rpcFreeCont
,
.
parentFreeBodyFp
=
(
ProcFreeFp
)
rpcFreeCont
,
.
testFlag
=
true
,
.
testFlag
=
true
,
...
...
source/dnode/mgmt/impl/mnodeMgmt/src/mmWorker.c
浏览文件 @
ad1609fe
...
@@ -139,6 +139,14 @@ void mmInitMsgFp(SMndMgmt *pMgmt) {
...
@@ -139,6 +139,14 @@ void mmInitMsgFp(SMndMgmt *pMgmt) {
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_DROP_STB_RSP
)]
=
mmProcessWriteMsg
;
pMgmt
->
msgFp
[
TMSG_INDEX
(
TDMT_VND_DROP_STB_RSP
)]
=
mmProcessWriteMsg
;
}
}
static
void
mmSendRpcRsp
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpc
)
{
if
(
pRpc
->
code
==
TSDB_CODE_DND_MNODE_NOT_DEPLOYED
||
pRpc
->
code
==
TSDB_CODE_APP_NOT_READY
)
{
dndSendRedirectRsp
(
pDnode
,
pRpc
);
}
else
{
rpcSendResponse
(
pRpc
);
}
}
static
int32_t
mmBuildMsg
(
SMndMsg
*
pMsg
,
SRpcMsg
*
pRpc
)
{
static
int32_t
mmBuildMsg
(
SMndMsg
*
pMsg
,
SRpcMsg
*
pRpc
)
{
SRpcConnInfo
connInfo
=
{
0
};
SRpcConnInfo
connInfo
=
{
0
};
if
((
pRpc
->
msgType
&
1U
)
&&
rpcGetConnInfo
(
pRpc
->
handle
,
&
connInfo
)
!=
0
)
{
if
((
pRpc
->
msgType
&
1U
)
&&
rpcGetConnInfo
(
pRpc
->
handle
,
&
connInfo
)
!=
0
)
{
...
@@ -183,15 +191,16 @@ void mmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
...
@@ -183,15 +191,16 @@ void mmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
_OVER:
_OVER:
if
(
code
!=
0
)
{
if
(
code
==
0
)
{
if
(
!
pMgmt
->
singleProc
)
{
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pRpc
->
pCont
);
}
}
else
{
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
if
(
isReq
)
{
if
(
isReq
)
{
if
(
terrno
==
TSDB_CODE_DND_MNODE_NOT_DEPLOYED
||
terrno
==
TSDB_CODE_APP_NOT_READY
)
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
ahandle
=
pRpc
->
ahandle
,
.
code
=
terrno
};
dndSendRedirectRsp
(
pDnode
,
pRpc
);
mmSendRpcRsp
(
pDnode
,
&
rsp
);
}
else
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
ahandle
=
pRpc
->
ahandle
,
.
code
=
terrno
};
rpcSendResponse
(
&
rsp
);
}
}
}
taosFreeQitem
(
pMsg
);
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pRpc
->
pCont
);
rpcFreeCont
(
pRpc
->
pCont
);
...
@@ -245,6 +254,22 @@ static int32_t mmPutRpcMsgToWorker(SDnode *pDnode, SDnodeWorker *pWorker, SRpcMs
...
@@ -245,6 +254,22 @@ static int32_t mmPutRpcMsgToWorker(SDnode *pDnode, SDnodeWorker *pWorker, SRpcMs
return
code
;
return
code
;
}
}
void
mmPutRpcRspToWorker
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpc
)
{
SMndMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
int32_t
code
=
-
1
;
if
(
pMgmt
->
singleProc
)
{
mmSendRpcRsp
(
pDnode
,
pRpc
);
}
else
{
do
{
code
=
taosProcPutToParentQueue
(
pMgmt
->
pProcess
,
pRpc
,
sizeof
(
SRpcMsg
),
pRpc
->
pCont
,
pRpc
->
contLen
);
if
(
code
!=
0
)
{
taosMsleep
(
10
);
}
}
while
(
code
!=
0
);
}
}
void
mmConsumeChildQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
)
{
void
mmConsumeChildQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
)
{
SMndMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
SMndMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
...
@@ -257,25 +282,23 @@ void mmConsumeChildQueue(SDnode *pDnode, SMndMsg *pMsg, int32_t msgLen, void *pC
...
@@ -257,25 +282,23 @@ void mmConsumeChildQueue(SDnode *pDnode, SMndMsg *pMsg, int32_t msgLen, void *pC
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
if
(
isReq
)
{
if
(
isReq
)
{
if
(
terrno
==
TSDB_CODE_DND_MNODE_NOT_DEPLOYED
||
terrno
==
TSDB_CODE_APP_NOT_READY
)
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
ahandle
=
pRpc
->
ahandle
,
.
code
=
terrno
};
dndSendRedirectRsp
(
pDnode
,
pRpc
);
mmPutRpcRspToWorker
(
pDnode
,
&
rsp
);
}
else
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
ahandle
=
pRpc
->
ahandle
,
.
code
=
terrno
};
rpcSendResponse
(
&
rsp
);
}
}
}
taosFreeQitem
(
pMsg
);
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pCont
);
rpcFreeCont
(
pCont
);
}
}
}
}
void
mmConsumeParentQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
)
{}
void
mmConsumeParentQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
int32_t
msgLen
,
void
*
pCont
,
int32_t
contLen
)
{
pMsg
->
pCont
=
pCont
;
mmSendRpcRsp
(
pDnode
,
pMsg
);
free
(
pMsg
);
}
static
void
mmConsumeMsgQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
)
{
static
void
mmConsumeMsgQueue
(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
)
{
SMnode
*
pMnode
=
mmAcquire
(
pDnode
);
SMnode
*
pMnode
=
mmAcquire
(
pDnode
);
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
void
*
ahandle
=
pMsg
->
rpcMsg
.
ahandle
;
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
bool
isReq
=
(
pRpc
->
msgType
&
1U
);
int32_t
code
=
-
1
;
int32_t
code
=
-
1
;
...
@@ -289,18 +312,15 @@ static void mmConsumeMsgQueue(SDnode *pDnode, SMndMsg *pMsg) {
...
@@ -289,18 +312,15 @@ static void mmConsumeMsgQueue(SDnode *pDnode, SMndMsg *pMsg) {
if
(
pMsg
->
rpcMsg
.
handle
==
NULL
)
return
;
if
(
pMsg
->
rpcMsg
.
handle
==
NULL
)
return
;
if
(
code
==
0
)
{
if
(
code
==
0
)
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
contLen
=
pMsg
->
contLen
,
.
pCont
=
pMsg
->
pCont
};
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
contLen
=
pMsg
->
contLen
,
.
pCont
=
pMsg
->
pCont
};
rpcSendResponse
(
&
rsp
);
mmPutRpcRspToWorker
(
pDnode
,
&
rsp
);
}
else
{
}
else
{
if
(
terrno
==
TSDB_CODE_APP_NOT_READY
)
{
if
(
terrno
!=
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
dndSendRedirectRsp
(
pDnode
,
pRpc
);
}
else
if
(
terrno
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
}
else
{
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
contLen
=
pMsg
->
contLen
,
.
pCont
=
pMsg
->
pCont
,
.
code
=
terrno
};
SRpcMsg
rsp
=
{.
handle
=
pRpc
->
handle
,
.
contLen
=
pMsg
->
contLen
,
.
pCont
=
pMsg
->
pCont
,
.
code
=
terrno
};
rpcSendResponse
(
&
rsp
);
mmPutRpcRspToWorker
(
pDnode
,
&
rsp
);
}
}
}
}
}
}
taosFreeQitem
(
pMsg
);
rpcFreeCont
(
pRpc
->
pCont
);
rpcFreeCont
(
pRpc
->
pCont
);
taosFreeQitem
(
pMsg
);
}
}
source/util/src/tprocess.c
浏览文件 @
ad1609fe
...
@@ -149,8 +149,8 @@ static int32_t taosProcQueuePush(SProcQueue *pQueue, char *pHead, int32_t rawHea
...
@@ -149,8 +149,8 @@ static int32_t taosProcQueuePush(SProcQueue *pQueue, char *pHead, int32_t rawHea
pthread_mutex_unlock
(
&
pQueue
->
mutex
);
pthread_mutex_unlock
(
&
pQueue
->
mutex
);
tsem_post
(
&
pQueue
->
sem
);
tsem_post
(
&
pQueue
->
sem
);
(
*
pQueue
->
freeHeadFp
)(
pHead
);
//
(*pQueue->freeHeadFp)(pHead);
(
*
pQueue
->
freeBodyFp
)(
pBody
);
//
(*pQueue->freeBodyFp)(pBody);
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录