Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c4306958
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看板
提交
c4306958
编写于
11月 27, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-11265 fix transport in dnode-mgmt
上级
c3a25985
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
37 addition
and
30 deletion
+37
-30
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+4
-8
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+3
-0
source/dnode/mgmt/impl/src/dndMnode.c
source/dnode/mgmt/impl/src/dndMnode.c
+23
-15
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+3
-3
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+4
-4
未找到文件。
include/dnode/mnode/mnode.h
浏览文件 @
c4306958
...
...
@@ -137,38 +137,34 @@ void mnodeSendRsp(SMnodeMsg *pMsg, int32_t code);
/**
* @brief Process the read request
*
* @param pMnode The mnode object
* @param pMsg The request msg
* @return int32_t 0 for success, -1 for failure
*/
void
mnodeProcessReadMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
);
void
mnodeProcessReadMsg
(
SMnodeMsg
*
pMsg
);
/**
* @brief Process the write request
*
* @param pMnode The mnode object
* @param pMsg The request msg
* @return int32_t 0 for success, -1 for failure
*/
void
mnodeProcessWriteMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
);
void
mnodeProcessWriteMsg
(
SMnodeMsg
*
pMsg
);
/**
* @brief Process the sync request
*
* @param pMnode The mnode object
* @param pMsg The request msg
* @return int32_t 0 for success, -1 for failure
*/
void
mnodeProcessSyncMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
);
void
mnodeProcessSyncMsg
(
SMnodeMsg
*
pMsg
);
/**
* @brief Process the apply request
*
* @param pMnode The mnode object
* @param pMsg The request msg
* @return int32_t 0 for success, -1 for failure
*/
void
mnodeProcessApplyMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
);
void
mnodeProcessApplyMsg
(
SMnodeMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
c4306958
...
...
@@ -121,12 +121,14 @@ static void dndResetDnodes(SDnode *pDnode, SDnodeEps *pDnodeEps) {
}
pMgmt
->
mnodeEpSet
.
inUse
=
0
;
pMgmt
->
mnodeEpSet
.
numOfEps
=
0
;
int32_t
mIndex
=
0
;
for
(
int32_t
i
=
0
;
i
<
pMgmt
->
dnodeEps
->
num
;
i
++
)
{
SDnodeEp
*
pDnodeEp
=
&
pMgmt
->
dnodeEps
->
eps
[
i
];
if
(
!
pDnodeEp
->
isMnode
)
continue
;
if
(
mIndex
>=
TSDB_MAX_REPLICA
)
continue
;
pMgmt
->
mnodeEpSet
.
numOfEps
++
;
strcpy
(
pMgmt
->
mnodeEpSet
.
fqdn
[
mIndex
],
pDnodeEp
->
fqdn
);
pMgmt
->
mnodeEpSet
.
port
[
mIndex
]
=
pDnodeEp
->
port
;
mIndex
++
;
...
...
@@ -279,6 +281,7 @@ PRASE_DNODE_OVER:
if
(
pMgmt
->
dnodeEps
==
NULL
)
{
pMgmt
->
dnodeEps
=
calloc
(
1
,
sizeof
(
SDnodeEps
)
+
sizeof
(
SDnodeEp
));
pMgmt
->
dnodeEps
->
num
=
1
;
pMgmt
->
dnodeEps
->
eps
[
0
].
isMnode
=
1
;
pMgmt
->
dnodeEps
->
eps
[
0
].
port
=
pDnode
->
opt
.
serverPort
;
tstrncpy
(
pMgmt
->
dnodeEps
->
eps
[
0
].
fqdn
,
pDnode
->
opt
.
localFqdn
,
TSDB_FQDN_LEN
);
}
...
...
source/dnode/mgmt/impl/src/dndMnode.c
浏览文件 @
c4306958
...
...
@@ -80,7 +80,9 @@ static SMnode *dndAcquireMnode(SDnode *pDnode) {
}
taosRUnLockLatch
(
&
pMgmt
->
latch
);
if
(
pMnode
!=
NULL
)
{
dTrace
(
"acquire mnode, refCount:%d"
,
refCount
);
}
return
pMnode
;
}
...
...
@@ -94,7 +96,9 @@ static void dndReleaseMnode(SDnode *pDnode, SMnode *pMnode) {
}
taosRUnLockLatch
(
&
pMgmt
->
latch
);
if
(
pMnode
!=
NULL
)
{
dTrace
(
"release mnode, refCount:%d"
,
refCount
);
}
}
static
int32_t
dndReadMnodeFile
(
SDnode
*
pDnode
)
{
...
...
@@ -550,7 +554,7 @@ static void dndProcessMnodeReadQueue(SDnode *pDnode, SMnodeMsg *pMsg) {
SMnode
*
pMnode
=
dndAcquireMnode
(
pDnode
);
if
(
pMnode
!=
NULL
)
{
mnodeProcessReadMsg
(
pM
node
,
pM
sg
);
mnodeProcessReadMsg
(
pMsg
);
dndReleaseMnode
(
pDnode
,
pMnode
);
}
else
{
mnodeSendRsp
(
pMsg
,
terrno
);
...
...
@@ -564,7 +568,7 @@ static void dndProcessMnodeWriteQueue(SDnode *pDnode, SMnodeMsg *pMsg) {
SMnode
*
pMnode
=
dndAcquireMnode
(
pDnode
);
if
(
pMnode
!=
NULL
)
{
mnodeProcessWriteMsg
(
pM
node
,
pM
sg
);
mnodeProcessWriteMsg
(
pMsg
);
dndReleaseMnode
(
pDnode
,
pMnode
);
}
else
{
mnodeSendRsp
(
pMsg
,
terrno
);
...
...
@@ -578,7 +582,7 @@ static void dndProcessMnodeApplyQueue(SDnode *pDnode, SMnodeMsg *pMsg) {
SMnode
*
pMnode
=
dndAcquireMnode
(
pDnode
);
if
(
pMnode
!=
NULL
)
{
mnodeProcessApplyMsg
(
pM
node
,
pM
sg
);
mnodeProcessApplyMsg
(
pMsg
);
dndReleaseMnode
(
pDnode
,
pMnode
);
}
else
{
mnodeSendRsp
(
pMsg
,
terrno
);
...
...
@@ -592,7 +596,7 @@ static void dndProcessMnodeSyncQueue(SDnode *pDnode, SMnodeMsg *pMsg) {
SMnode
*
pMnode
=
dndAcquireMnode
(
pDnode
);
if
(
pMnode
!=
NULL
)
{
mnodeProcessSyncMsg
(
pM
node
,
pM
sg
);
mnodeProcessSyncMsg
(
pMsg
);
dndReleaseMnode
(
pDnode
,
pMnode
);
}
else
{
mnodeSendRsp
(
pMsg
,
terrno
);
...
...
@@ -683,7 +687,7 @@ static int32_t dndPutMsgIntoMnodeApplyQueue(SDnode *pDnode, SMnodeMsg *pMsg) {
static
int32_t
dndAllocMnodeMgmtQueue
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
pMgmt
->
pMgmtQ
=
tWorkerAllocQueue
(
&
pMgmt
->
mgmtPool
,
NULL
,
(
FProcessItem
)
dndProcessMnodeMgmtQueue
);
pMgmt
->
pMgmtQ
=
tWorkerAllocQueue
(
&
pMgmt
->
mgmtPool
,
pDnode
,
(
FProcessItem
)
dndProcessMnodeMgmtQueue
);
if
(
pMgmt
->
pMgmtQ
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -708,18 +712,19 @@ static int32_t dndInitMnodeMgmtWorker(SDnode *pDnode) {
return
-
1
;
}
dDebug
(
"mnode mgmt worker is initialized"
);
return
0
;
}
static
void
dndCleanupMnodeMgmtWorker
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
tWorkerCleanup
(
&
pMgmt
->
mgmtPool
);
dDebug
(
"mnode mgmt worker is
stopp
ed"
);
dDebug
(
"mnode mgmt worker is
clos
ed"
);
}
static
int32_t
dndAllocMnodeReadQueue
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
pMgmt
->
pReadQ
=
tWorkerAllocQueue
(
&
pMgmt
->
readPool
,
NULL
,
(
FProcessItem
)
dndProcessMnodeReadQueue
);
pMgmt
->
pReadQ
=
tWorkerAllocQueue
(
&
pMgmt
->
readPool
,
pDnode
,
(
FProcessItem
)
dndProcessMnodeReadQueue
);
if
(
pMgmt
->
pReadQ
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -745,18 +750,19 @@ static int32_t dndInitMnodeReadWorker(SDnode *pDnode) {
return
-
1
;
}
dDebug
(
"mnode read worker is initialized"
);
return
0
;
}
static
void
dndCleanupMnodeReadWorker
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
tWorkerCleanup
(
&
pMgmt
->
readPool
);
dDebug
(
"mnode read worker is
stopp
ed"
);
dDebug
(
"mnode read worker is
clos
ed"
);
}
static
int32_t
dndAllocMnodeWriteQueue
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
pMgmt
->
pWriteQ
=
tWorkerAllocQueue
(
&
pMgmt
->
writePool
,
NULL
,
(
FProcessItem
)
dndProcessMnodeWriteQueue
);
pMgmt
->
pWriteQ
=
tWorkerAllocQueue
(
&
pMgmt
->
writePool
,
pDnode
,
(
FProcessItem
)
dndProcessMnodeWriteQueue
);
if
(
pMgmt
->
pWriteQ
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -773,7 +779,7 @@ static void dndFreeMnodeWriteQueue(SDnode *pDnode) {
static
int32_t
dndAllocMnodeApplyQueue
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
pMgmt
->
pApplyQ
=
tWorkerAllocQueue
(
&
pMgmt
->
writePool
,
NULL
,
(
FProcessItem
)
dndProcessMnodeApplyQueue
);
pMgmt
->
pApplyQ
=
tWorkerAllocQueue
(
&
pMgmt
->
writePool
,
pDnode
,
(
FProcessItem
)
dndProcessMnodeApplyQueue
);
if
(
pMgmt
->
pApplyQ
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -799,18 +805,19 @@ static int32_t dndInitMnodeWriteWorker(SDnode *pDnode) {
return
-
1
;
}
dDebug
(
"mnode write worker is initialized"
);
return
0
;
}
static
void
dndCleanupMnodeWriteWorker
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
tWorkerCleanup
(
&
pMgmt
->
writePool
);
dDebug
(
"mnode write worker is
stopp
ed"
);
dDebug
(
"mnode write worker is
clos
ed"
);
}
static
int32_t
dndAllocMnodeSyncQueue
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
pMgmt
->
pSyncQ
=
tWorkerAllocQueue
(
&
pMgmt
->
syncPool
,
NULL
,
(
FProcessItem
)
dndProcessMnodeSyncQueue
);
pMgmt
->
pSyncQ
=
tWorkerAllocQueue
(
&
pMgmt
->
syncPool
,
pDnode
,
(
FProcessItem
)
dndProcessMnodeSyncQueue
);
if
(
pMgmt
->
pSyncQ
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -836,13 +843,14 @@ static int32_t dndInitMnodeSyncWorker(SDnode *pDnode) {
return
-
1
;
}
dDebug
(
"mnode sync worker is initialized"
);
return
0
;
}
static
void
dndCleanupMnodeSyncWorker
(
SDnode
*
pDnode
)
{
SMnodeMgmt
*
pMgmt
=
&
pDnode
->
mmgmt
;
tWorkerCleanup
(
&
pMgmt
->
syncPool
);
dDebug
(
"mnode sync worker is
stopp
ed"
);
dDebug
(
"mnode sync worker is
clos
ed"
);
}
int32_t
dndInitMnode
(
SDnode
*
pDnode
)
{
...
...
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
c4306958
...
...
@@ -261,12 +261,12 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
SDnode
*
pDnode
=
parent
;
if
(
dndAuthInternalMsg
(
parent
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
dTrace
(
"get internal auth success"
);
//
dTrace("get internal auth success");
return
0
;
}
if
(
dndGetUserAuthFromMnode
(
pDnode
,
user
,
spi
,
encrypt
,
secret
,
ckey
)
==
0
)
{
dTrace
(
"get auth from internal mnode"
);
//
dTrace("get auth from internal mnode");
return
0
;
}
...
...
@@ -275,7 +275,7 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
return
-
1
;
}
dDebug
(
"user:%s, send auth msg to other mnodes"
,
user
);
//
dDebug("user:%s, send auth msg to other mnodes", user);
SAuthMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SAuthMsg
));
tstrncpy
(
pMsg
->
user
,
user
,
TSDB_USER_LEN
);
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
c4306958
...
...
@@ -234,13 +234,13 @@ void mnodeSetMsgFp(int32_t msgType, MnodeRpcFp fp) {
}
}
void
mnodeProcessReadMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessReadMsg
(
SMnodeMsg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessWriteMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessWriteMsg
(
SMnodeMsg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessSyncMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessSyncMsg
(
SMnodeMsg
*
pMsg
)
{
mnodeProcessRpcMsg
(
pMsg
);
}
void
mnodeProcessApplyMsg
(
SMnode
*
pMnode
,
SMnode
Msg
*
pMsg
)
{}
void
mnodeProcessApplyMsg
(
SMnodeMsg
*
pMsg
)
{}
#if 0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录