Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43f7e18c
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看板
提交
43f7e18c
编写于
2月 16, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
serialize timer msg
上级
03c026a5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
52 addition
and
13 deletion
+52
-13
include/common/tmsg.h
include/common/tmsg.h
+5
-6
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+26
-1
source/dnode/mgmt/impl/src/dndMgmt.c
source/dnode/mgmt/impl/src/dndMgmt.c
+1
-1
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+19
-4
未找到文件。
include/common/tmsg.h
浏览文件 @
43f7e18c
...
...
@@ -720,8 +720,11 @@ int32_t tSerializeSStatusRsp(void* buf, int32_t bufLen, SStatusRsp* pRsp);
int32_t
tDeserializeSStatusRsp
(
void
*
buf
,
int32_t
bufLen
,
SStatusRsp
*
pRsp
);
typedef
struct
{
int32_t
reserve
;
}
STransReq
;
int32_t
reserved
;
}
SMTimerReq
;
int32_t
tSerializeSMTimerMsg
(
void
*
buf
,
int32_t
bufLen
,
SMTimerReq
*
pReq
);
int32_t
tDeserializeSMTimerMsg
(
void
*
buf
,
int32_t
bufLen
,
SMTimerReq
*
pReq
);
typedef
struct
{
int32_t
id
;
...
...
@@ -1195,10 +1198,6 @@ static FORCE_INLINE void* tDeserializeSMVSubscribeReq(void* buf, SMVSubscribeReq
return
buf
;
}
typedef
struct
{
int32_t
reserved
;
}
SMqTmrMsg
;
typedef
struct
{
const
char
*
key
;
SArray
*
lostConsumers
;
// SArray<int64_t>
...
...
include/common/tmsgdef.h
浏览文件 @
43f7e18c
...
...
@@ -142,7 +142,7 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_DROP_TOPIC
,
"mnode-drop-topic"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_SUBSCRIBE
,
"mnode-subscribe"
,
SCMSubscribeReq
,
SCMSubscribeRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_GET_SUB_EP
,
"mnode-get-sub-ep"
,
SMqCMGetSubEpReq
,
SMqCMGetSubEpRsp
)
TD_DEF_MSG_TYPE
(
TDMT_MND_MQ_TIMER
,
"mnode-mq-timer"
,
SM
qTmrMsg
,
SMqTmrMsg
)
TD_DEF_MSG_TYPE
(
TDMT_MND_MQ_TIMER
,
"mnode-mq-timer"
,
SM
TimerReq
,
SMTimerReq
)
TD_DEF_MSG_TYPE
(
TDMT_MND_MQ_DO_REBALANCE
,
"mnode-mq-do-rebalance"
,
SMqDoRebalanceMsg
,
SMqDoRebalanceMsg
)
// Requests handled by VNODE
...
...
source/common/src/tmsg.c
浏览文件 @
43f7e18c
...
...
@@ -1984,7 +1984,7 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
acctId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pRsp
->
clusterId
)
<
0
)
return
-
1
;
if
(
tDecodeI64
(
&
decoder
,
&
pRsp
->
clusterId
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
connId
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
superUser
)
<
0
)
return
-
1
;
if
(
tDecodeSEpSet
(
&
decoder
,
&
pRsp
->
epSet
)
<
0
)
return
-
1
;
...
...
@@ -1994,3 +1994,28 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
tCoderClear
(
&
decoder
);
return
0
;
}
int32_t
tSerializeSMTimerMsg
(
void
*
buf
,
int32_t
bufLen
,
SMTimerReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
if
(
tStartEncode
(
&
encoder
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
reserved
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
tCoderClear
(
&
encoder
);
return
tlen
;
}
int32_t
tDeserializeSMTimerMsg
(
void
*
buf
,
int32_t
bufLen
,
SMTimerReq
*
pReq
)
{
SCoder
decoder
=
{
0
};
tCoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_DECODER
);
if
(
tStartDecode
(
&
decoder
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
reserved
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tCoderClear
(
&
decoder
);
return
0
;
}
source/dnode/mgmt/impl/src/dndMgmt.c
浏览文件 @
43f7e18c
...
...
@@ -394,7 +394,7 @@ void dndSendStatusReq(SDnode *pDnode) {
static
void
dndUpdateDnodeCfg
(
SDnode
*
pDnode
,
SDnodeCfg
*
pCfg
)
{
SDnodeMgmt
*
pMgmt
=
&
pDnode
->
dmgmt
;
if
(
pMgmt
->
dnodeId
==
0
)
{
dInfo
(
"set dnodeId:%d clusterId:
0x
%"
PRId64
,
pCfg
->
dnodeId
,
pCfg
->
clusterId
);
dInfo
(
"set dnodeId:%d clusterId:%"
PRId64
,
pCfg
->
dnodeId
,
pCfg
->
clusterId
);
taosWLockLatch
(
&
pMgmt
->
latch
);
pMgmt
->
dnodeId
=
pCfg
->
dnodeId
;
pMgmt
->
clusterId
=
pCfg
->
clusterId
;
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
43f7e18c
...
...
@@ -60,11 +60,25 @@ void mndSendRedirectRsp(SMnode *pMnode, SRpcMsg *pMsg) {
}
}
static
void
*
mndBuildTimerMsg
(
int32_t
*
pContLen
)
{
SMTimerReq
timerReq
=
{
0
};
int32_t
contLen
=
tSerializeSMTimerMsg
(
NULL
,
0
,
&
timerReq
);
if
(
contLen
<=
0
)
return
NULL
;
void
*
pReq
=
rpcMallocCont
(
contLen
);
if
(
pReq
==
NULL
)
return
NULL
;
tSerializeSMTimerMsg
(
pReq
,
contLen
,
&
timerReq
);
*
pContLen
=
contLen
;
return
pReq
;
}
static
void
mndTransReExecute
(
void
*
param
,
void
*
tmrId
)
{
SMnode
*
pMnode
=
param
;
if
(
mndIsMaster
(
pMnode
))
{
STransReq
*
pMsg
=
rpcMallocCont
(
sizeof
(
STransReq
));
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TRANS
,
.
pCont
=
pMsg
,
.
contLen
=
sizeof
(
STransReq
)};
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TRANS
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
pMnode
->
putReqToMWriteQFp
(
pMnode
->
pDnode
,
&
rpcMsg
);
}
...
...
@@ -74,8 +88,9 @@ static void mndTransReExecute(void *param, void *tmrId) {
static
void
mndCalMqRebalance
(
void
*
param
,
void
*
tmrId
)
{
SMnode
*
pMnode
=
param
;
if
(
mndIsMaster
(
pMnode
))
{
SMqTmrMsg
*
pMsg
=
rpcMallocCont
(
sizeof
(
SMqTmrMsg
));
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_MQ_TIMER
,
.
pCont
=
pMsg
,
.
contLen
=
sizeof
(
SMqTmrMsg
)};
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_MQ_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
pMnode
->
putReqToMReadQFp
(
pMnode
->
pDnode
,
&
rpcMsg
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录