Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
23432573
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
23432573
编写于
5月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: enable multi-process mode
上级
47dde964
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
24 deletion
+27
-24
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
+1
-1
source/dnode/mgmt/node_mgmt/src/dmNodes.c
source/dnode/mgmt/node_mgmt/src/dmNodes.c
+1
-1
source/dnode/mgmt/node_mgmt/src/dmProc.c
source/dnode/mgmt/node_mgmt/src/dmProc.c
+3
-3
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+22
-19
未找到文件。
source/dnode/mgmt/node_mgmt/src/dmMgmt.c
浏览文件 @
23432573
...
@@ -267,7 +267,7 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper) {
...
@@ -267,7 +267,7 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper) {
int32_t
code
=
0
;
int32_t
code
=
0
;
taosRLockLatch
(
&
pWrapper
->
latch
);
taosRLockLatch
(
&
pWrapper
->
latch
);
if
(
pWrapper
->
deployed
||
(
InParentProc
(
pWrapper
->
proc
.
ptype
)
&&
pWrapper
->
required
)
)
{
if
(
pWrapper
->
deployed
/* || (OnlyInParentProc(pWrapper->proc.ptype) && pWrapper->required) */
)
{
int32_t
refCount
=
atomic_add_fetch_32
(
&
pWrapper
->
refCount
,
1
);
int32_t
refCount
=
atomic_add_fetch_32
(
&
pWrapper
->
refCount
,
1
);
dTrace
(
"node:%s, is marked, ref:%d"
,
pWrapper
->
name
,
refCount
);
dTrace
(
"node:%s, is marked, ref:%d"
,
pWrapper
->
name
,
refCount
);
}
else
{
}
else
{
...
...
source/dnode/mgmt/node_mgmt/src/dmNodes.c
浏览文件 @
23432573
...
@@ -73,7 +73,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
...
@@ -73,7 +73,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
SMgmtOutputOpt
output
=
{
0
};
SMgmtOutputOpt
output
=
{
0
};
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
SMgmtInputOpt
input
=
dmBuildMgmtInputOpt
(
pWrapper
);
if
(
pWrapper
->
ntype
==
DNODE
||
Only
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
pWrapper
->
ntype
==
DNODE
||
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
tmsgSetDefaultMsgCb
(
&
input
.
msgCb
);
tmsgSetDefaultMsgCb
(
&
input
.
msgCb
);
}
}
...
...
source/dnode/mgmt/node_mgmt/src/dmProc.c
浏览文件 @
23432573
...
@@ -185,7 +185,7 @@ static int32_t dmPushToProcQueue(SProc *proc, SProcQueue *queue, const char *pHe
...
@@ -185,7 +185,7 @@ static int32_t dmPushToProcQueue(SProc *proc, SProcQueue *queue, const char *pHe
taosThreadMutexUnlock
(
&
queue
->
mutex
);
taosThreadMutexUnlock
(
&
queue
->
mutex
);
tsem_post
(
&
queue
->
sem
);
tsem_post
(
&
queue
->
sem
);
dTrace
(
"node:%s, push %s msg:%p
%d cont:%p
%d, pos:%d remain:%d"
,
queue
->
name
,
dmFuncStr
(
ftype
),
pHead
,
headLen
,
dTrace
(
"node:%s, push %s msg:%p
:%d cont:%p:
%d, pos:%d remain:%d"
,
queue
->
name
,
dmFuncStr
(
ftype
),
pHead
,
headLen
,
pBody
,
bodyLen
,
pos
,
queue
->
items
);
pBody
,
bodyLen
,
pos
,
queue
->
items
);
return
0
;
return
0
;
}
}
...
@@ -269,8 +269,8 @@ static int32_t dmPopFromProcQueue(SProcQueue *queue, void **ppHead, int16_t *pHe
...
@@ -269,8 +269,8 @@ static int32_t dmPopFromProcQueue(SProcQueue *queue, void **ppHead, int16_t *pHe
*
pBodyLen
=
rawBodyLen
;
*
pBodyLen
=
rawBodyLen
;
*
pFuncType
=
(
EProcFuncType
)
ftype
;
*
pFuncType
=
(
EProcFuncType
)
ftype
;
dTrace
(
"node:%s, pop %s msg:%p
%d body:%p %d, pos:%d remain:%d"
,
queue
->
name
,
dmFuncStr
(
ftype
),
pHead
,
rawHeadLen
,
dTrace
(
"node:%s, pop %s msg:%p
:%d cont:%p:%d, pos:%d remain:%d"
,
queue
->
name
,
dmFuncStr
(
ftype
),
pHead
,
headLen
,
pBody
,
pBody
,
rawB
odyLen
,
pos
,
queue
->
items
);
b
odyLen
,
pos
,
queue
->
items
);
return
1
;
return
1
;
}
}
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
23432573
...
@@ -82,24 +82,27 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
...
@@ -82,24 +82,27 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
if
(
msgType
==
TDMT_DND_NET_TEST
)
{
if
(
msgType
==
TDMT_DND_NET_TEST
)
{
dmProcessNetTestReq
(
pDnode
,
pRpc
);
dmProcessNetTestReq
(
pDnode
,
pRpc
);
code
=
0
;
return
;
goto
_OVER
;
}
else
if
(
msgType
==
TDMT_MND_SYSTABLE_RETRIEVE_RSP
||
msgType
==
TDMT_VND_FETCH_RSP
)
{
}
else
if
(
msgType
==
TDMT_MND_SYSTABLE_RETRIEVE_RSP
||
msgType
==
TDMT_VND_FETCH_RSP
)
{
code
=
qWorkerProcessFetchRsp
(
NULL
,
NULL
,
pRpc
);
code
=
qWorkerProcessFetchRsp
(
NULL
,
NULL
,
pRpc
);
pRpc
->
pCont
=
NULL
;
// will be freed in qworker
pRpc
->
pCont
=
NULL
;
// will be freed in qworker
code
=
0
;
return
;
goto
_OVER
;
}
else
{
}
else
{
}
}
if
(
pDnode
->
status
!=
DND_STAT_RUNNING
)
{
if
(
pDnode
->
status
!=
DND_STAT_RUNNING
)
{
if
(
msgType
==
TDMT_DND_SERVER_STATUS
)
{
if
(
msgType
==
TDMT_DND_SERVER_STATUS
)
{
dmProcessServerStartupStatus
(
pDnode
,
pRpc
);
dmProcessServerStartupStatus
(
pDnode
,
pRpc
);
code
=
0
;
}
else
{
}
else
{
terrno
=
TSDB_CODE_APP_NOT_READY
;
SRpcMsg
rspMsg
=
{
.
handle
=
pRpc
->
handle
,
.
code
=
TSDB_CODE_APP_NOT_READY
,
.
ahandle
=
pRpc
->
ahandle
,
.
refId
=
pRpc
->
refId
,
};
rpcSendResponse
(
&
rspMsg
);
}
}
goto
_OVER
;
return
;
}
}
if
(
isReq
&&
pRpc
->
pCont
==
NULL
)
{
if
(
isReq
&&
pRpc
->
pCont
==
NULL
)
{
...
@@ -282,15 +285,17 @@ static inline int32_t dmSendReq(SMgmtWrapper *pWrapper, const SEpSet *pEpSet, SR
...
@@ -282,15 +285,17 @@ static inline int32_t dmSendReq(SMgmtWrapper *pWrapper, const SEpSet *pEpSet, SR
}
}
static
inline
void
dmSendRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
)
{
static
inline
void
dmSendRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
)
{
if
(
!
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
dmSendRpcRsp
(
pWrapper
->
pDnode
,
pRsp
);
}
else
{
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pRsp
,
sizeof
(
SRpcMsg
),
pRsp
->
pCont
,
pRsp
->
contLen
,
DND_FUNC_RSP
);
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pRsp
,
sizeof
(
SRpcMsg
),
pRsp
->
pCont
,
pRsp
->
contLen
,
DND_FUNC_RSP
);
}
else
{
dmSendRpcRsp
(
pWrapper
->
pDnode
,
pRsp
);
}
}
}
}
static
inline
void
dmSendRedirectRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
,
const
SEpSet
*
pNewEpSet
)
{
static
inline
void
dmSendRedirectRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
,
const
SEpSet
*
pNewEpSet
)
{
if
(
!
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pRsp
,
sizeof
(
SRpcMsg
),
pRsp
->
pCont
,
pRsp
->
contLen
,
DND_FUNC_RSP
);
}
else
{
SRpcMsg
rsp
=
{
0
};
SRpcMsg
rsp
=
{
0
};
SMEpSet
msg
=
{.
epSet
=
*
pNewEpSet
};
SMEpSet
msg
=
{.
epSet
=
*
pNewEpSet
};
int32_t
len
=
tSerializeSMEpSet
(
NULL
,
0
,
&
msg
);
int32_t
len
=
tSerializeSMEpSet
(
NULL
,
0
,
&
msg
);
...
@@ -302,25 +307,23 @@ static inline void dmSendRedirectRsp(SMgmtWrapper *pWrapper, const SRpcMsg *pRsp
...
@@ -302,25 +307,23 @@ static inline void dmSendRedirectRsp(SMgmtWrapper *pWrapper, const SRpcMsg *pRsp
rsp
.
handle
=
pRsp
->
handle
;
rsp
.
handle
=
pRsp
->
handle
;
rsp
.
refId
=
pRsp
->
refId
;
rsp
.
refId
=
pRsp
->
refId
;
rpcSendResponse
(
&
rsp
);
rpcSendResponse
(
&
rsp
);
}
else
{
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pRsp
,
sizeof
(
SRpcMsg
),
pRsp
->
pCont
,
pRsp
->
contLen
,
DND_FUNC_RSP
);
}
}
}
}
static
inline
void
dmRegisterBrokenLinkArg
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
)
{
static
inline
void
dmRegisterBrokenLinkArg
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
)
{
if
(
!
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
rpcRegisterBrokenLinkArg
(
pMsg
);
}
else
{
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pMsg
,
sizeof
(
SRpcMsg
),
pMsg
->
pCont
,
pMsg
->
contLen
,
DND_FUNC_REGIST
);
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
pMsg
,
sizeof
(
SRpcMsg
),
pMsg
->
pCont
,
pMsg
->
contLen
,
DND_FUNC_REGIST
);
}
else
{
rpcRegisterBrokenLinkArg
(
pMsg
);
}
}
}
}
static
inline
void
dmReleaseHandle
(
SMgmtWrapper
*
pWrapper
,
void
*
handle
,
int8_t
type
)
{
static
inline
void
dmReleaseHandle
(
SMgmtWrapper
*
pWrapper
,
void
*
handle
,
int8_t
type
)
{
if
(
!
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
rpcReleaseHandle
(
handle
,
type
);
}
else
{
SRpcMsg
msg
=
{.
handle
=
handle
,
.
code
=
type
};
SRpcMsg
msg
=
{.
handle
=
handle
,
.
code
=
type
};
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
&
msg
,
sizeof
(
SRpcMsg
),
NULL
,
0
,
DND_FUNC_RELEASE
);
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
&
msg
,
sizeof
(
SRpcMsg
),
NULL
,
0
,
DND_FUNC_RELEASE
);
}
else
{
rpcReleaseHandle
(
handle
,
type
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录