Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7c588cc0
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看板
提交
7c588cc0
编写于
4月 19, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: report startup steps
上级
7d658025
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
39 addition
and
5 deletion
+39
-5
include/common/tmsgcb.h
include/common/tmsgcb.h
+3
-0
source/common/src/tmsgcb.c
source/common/src/tmsgcb.c
+4
-0
source/dnode/mgmt/implement/src/dmExec.c
source/dnode/mgmt/implement/src/dmExec.c
+2
-0
source/dnode/mgmt/implement/src/dmHandle.c
source/dnode/mgmt/implement/src/dmHandle.c
+5
-3
source/dnode/mgmt/implement/src/dmTransport.c
source/dnode/mgmt/implement/src/dmTransport.c
+1
-1
source/dnode/mgmt/implement/src/dmWorker.c
source/dnode/mgmt/implement/src/dmWorker.c
+2
-0
source/dnode/mgmt/interface/inc/dmInt.h
source/dnode/mgmt/interface/inc/dmInt.h
+1
-0
source/dnode/mgmt/interface/src/dmInt.c
source/dnode/mgmt/interface/src/dmInt.c
+6
-0
source/dnode/mgmt/mgmt_bnode/src/bmInt.c
source/dnode/mgmt/mgmt_bnode/src/bmInt.c
+2
-0
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
+2
-0
source/dnode/mgmt/mgmt_qnode/src/qmInt.c
source/dnode/mgmt/mgmt_qnode/src/qmInt.c
+2
-0
source/dnode/mgmt/mgmt_snode/src/smInt.c
source/dnode/mgmt/mgmt_snode/src/smInt.c
+2
-0
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+6
-1
source/dnode/mnode/impl/src/mnode.c
source/dnode/mnode/impl/src/mnode.c
+1
-0
未找到文件。
include/common/tmsgcb.h
浏览文件 @
7c588cc0
...
...
@@ -44,6 +44,7 @@ typedef int32_t (*SendMnodeReqFp)(SMgmtWrapper* pWrapper, SRpcMsg* pReq);
typedef
void
(
*
SendRspFp
)(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
typedef
void
(
*
RegisterBrokenLinkArgFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
typedef
void
(
*
ReleaseHandleFp
)(
SMgmtWrapper
*
pWrapper
,
void
*
handle
,
int8_t
type
);
typedef
void
(
*
ReportStartup
)(
SMgmtWrapper
*
pWrapper
,
const
char
*
name
,
const
char
*
desc
);
typedef
struct
{
SMgmtWrapper
*
pWrapper
;
...
...
@@ -53,6 +54,7 @@ typedef struct {
SendRspFp
sendRspFp
;
RegisterBrokenLinkArgFp
registerBrokenLinkArgFp
;
ReleaseHandleFp
releaseHandleFp
;
ReportStartup
reportStartupFp
;
}
SMsgCb
;
void
tmsgSetDefaultMsgCb
(
const
SMsgCb
*
pMsgCb
);
...
...
@@ -62,6 +64,7 @@ int32_t tmsgSendReq(const SMsgCb* pMsgCb, const SEpSet* epSet, SRpcMsg* pReq);
void
tmsgSendRsp
(
const
SRpcMsg
*
pRsp
);
void
tmsgRegisterBrokenLinkArg
(
const
SMsgCb
*
pMsgCb
,
SRpcMsg
*
pMsg
);
void
tmsgReleaseHandle
(
void
*
handle
,
int8_t
type
);
void
tmsgReportStartup
(
const
char
*
name
,
const
char
*
desc
);
#ifdef __cplusplus
}
...
...
source/common/src/tmsgcb.c
浏览文件 @
7c588cc0
...
...
@@ -40,4 +40,8 @@ void tmsgRegisterBrokenLinkArg(const SMsgCb* pMsgCb, SRpcMsg* pMsg) {
void
tmsgReleaseHandle
(
void
*
handle
,
int8_t
type
)
{
(
*
tsDefaultMsgCb
.
releaseHandleFp
)(
tsDefaultMsgCb
.
pWrapper
,
handle
,
type
);
}
void
tmsgReportStartup
(
const
char
*
name
,
const
char
*
desc
)
{
(
*
tsDefaultMsgCb
.
reportStartupFp
)(
tsDefaultMsgCb
.
pWrapper
,
name
,
desc
);
}
\ No newline at end of file
source/dnode/mgmt/implement/src/dmExec.c
浏览文件 @
7c588cc0
...
...
@@ -140,6 +140,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
if
(
dmRunParentProc
(
pWrapper
)
!=
0
)
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
pWrapper
->
name
,
"openned"
);
return
0
;
}
...
...
@@ -161,6 +162,7 @@ int32_t dmStartNode(SMgmtWrapper *pWrapper) {
}
}
dmReportStartup
(
pWrapper
->
pDnode
,
pWrapper
->
name
,
"started"
);
return
0
;
}
...
...
source/dnode/mgmt/implement/src/dmHandle.c
浏览文件 @
7c588cc0
...
...
@@ -36,7 +36,8 @@ static int32_t dmProcessStatusRsp(SDnode *pDnode, SRpcMsg *pRsp) {
}
}
else
{
SStatusRsp
statusRsp
=
{
0
};
if
(
pRsp
->
pCont
!=
NULL
&&
pRsp
->
contLen
>
0
&&
tDeserializeSStatusRsp
(
pRsp
->
pCont
,
pRsp
->
contLen
,
&
statusRsp
)
==
0
)
{
if
(
pRsp
->
pCont
!=
NULL
&&
pRsp
->
contLen
>
0
&&
tDeserializeSStatusRsp
(
pRsp
->
pCont
,
pRsp
->
contLen
,
&
statusRsp
)
==
0
)
{
pDnode
->
data
.
dnodeVer
=
statusRsp
.
dnodeVer
;
dmUpdateDnodeCfg
(
pDnode
,
&
statusRsp
.
dnodeCfg
);
dmUpdateEps
(
pDnode
,
statusRsp
.
pDnodeEps
);
...
...
@@ -76,7 +77,7 @@ void dmSendStatusReq(SDnode *pDnode) {
req
.
pVloads
=
info
.
pVloads
;
int32_t
contLen
=
tSerializeSStatusReq
(
NULL
,
0
,
&
req
);
void
*
pHead
=
rpcMallocCont
(
contLen
);
void
*
pHead
=
rpcMallocCont
(
contLen
);
tSerializeSStatusReq
(
pHead
,
contLen
,
&
req
);
tFreeSStatusReq
(
&
req
);
...
...
@@ -101,7 +102,7 @@ int32_t dmProcessGrantRsp(SDnode *pDnode, SNodeMsg *pMsg) {
}
int32_t
dmProcessConfigReq
(
SDnode
*
pDnode
,
SNodeMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDCfgDnodeReq
*
pCfg
=
pReq
->
pCont
;
dError
(
"config req is received, but not supported yet"
);
return
TSDB_CODE_OPS_NOT_SUPPORT
;
...
...
@@ -230,6 +231,7 @@ static int32_t dmInitMgmt(SMgmtWrapper *pWrapper) {
dError
(
"failed to init transport since %s"
,
terrstr
());
return
-
1
;
}
dmReportStartup
(
pDnode
,
"dnode-transport"
,
"initialized"
);
dInfo
(
"dnode-mgmt is initialized"
);
return
0
;
...
...
source/dnode/mgmt/implement/src/dmTransport.c
浏览文件 @
7c588cc0
...
...
@@ -505,7 +505,6 @@ static void dmCleanupServer(SDnode *pDnode) {
int32_t
dmInitTrans
(
SDnode
*
pDnode
)
{
if
(
dmInitServer
(
pDnode
)
!=
0
)
return
-
1
;
if
(
dmInitClient
(
pDnode
)
!=
0
)
return
-
1
;
dmReportStartup
(
pDnode
,
"transport"
,
"initialized"
);
return
0
;
}
...
...
@@ -520,6 +519,7 @@ SMsgCb dmGetMsgcb(SMgmtWrapper *pWrapper) {
.
sendRspFp
=
dmSendRsp
,
.
registerBrokenLinkArgFp
=
dmRegisterBrokenLinkArg
,
.
releaseHandleFp
=
dmReleaseHandle
,
.
reportStartupFp
=
dmReportStartupByWrapper
,
.
pWrapper
=
pWrapper
,
};
return
msgCb
;
...
...
source/dnode/mgmt/implement/src/dmWorker.c
浏览文件 @
7c588cc0
...
...
@@ -74,6 +74,7 @@ int32_t dmStartStatusThread(SDnode *pDnode) {
return
-
1
;
}
dmReportStartup
(
pDnode
,
"dnode-status"
,
"initialized"
);
return
0
;
}
...
...
@@ -92,6 +93,7 @@ int32_t dmStartMonitorThread(SDnode *pDnode) {
return
-
1
;
}
dmReportStartup
(
pDnode
,
"dnode-monitor"
,
"initialized"
);
return
0
;
}
...
...
source/dnode/mgmt/interface/inc/dmInt.h
浏览文件 @
7c588cc0
...
...
@@ -35,6 +35,7 @@ void dmSetStatus(SDnode *pDnode, EDndRunStatus stat);
void
dmSetEvent
(
SDnode
*
pDnode
,
EDndEvent
event
);
void
dmSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
tmsg_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int8_t
vgId
);
void
dmReportStartup
(
SDnode
*
pDnode
,
const
char
*
pName
,
const
char
*
pDesc
);
void
dmReportStartupByWrapper
(
SMgmtWrapper
*
pWrapper
,
const
char
*
pName
,
const
char
*
pDesc
);
void
dmProcessServerStatusReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dmGetMonitorSysInfo
(
SMonSysInfo
*
pInfo
);
...
...
source/dnode/mgmt/interface/src/dmInt.c
浏览文件 @
7c588cc0
...
...
@@ -140,6 +140,12 @@ void dmReportStartup(SDnode *pDnode, const char *pName, const char *pDesc) {
SStartupInfo
*
pStartup
=
&
pDnode
->
startup
;
tstrncpy
(
pStartup
->
name
,
pName
,
TSDB_STEP_NAME_LEN
);
tstrncpy
(
pStartup
->
desc
,
pDesc
,
TSDB_STEP_DESC_LEN
);
dInfo
(
"step:%s, %s"
,
pStartup
->
name
,
pStartup
->
desc
);
taosMsleep
(
300
);
}
void
dmReportStartupByWrapper
(
SMgmtWrapper
*
pWrapper
,
const
char
*
pName
,
const
char
*
pDesc
)
{
dmReportStartup
(
pWrapper
->
pDnode
,
pName
,
pDesc
);
}
static
void
dmGetServerStatus
(
SDnode
*
pDnode
,
SServerStatusRsp
*
pStatus
)
{
...
...
source/dnode/mgmt/mgmt_bnode/src/bmInt.c
浏览文件 @
7c588cc0
...
...
@@ -61,12 +61,14 @@ int32_t bmOpen(SMgmtWrapper *pWrapper) {
bmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"bnode-impl"
,
"initialized"
);
if
(
bmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start bnode worker since %s"
,
terrstr
());
bmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"bnode-worker"
,
"initialized"
);
return
0
;
}
...
...
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
浏览文件 @
7c588cc0
...
...
@@ -176,12 +176,14 @@ static int32_t mmOpen(SMgmtWrapper *pWrapper) {
mmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"mnode-impl"
,
"initialized"
);
if
(
mmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start mnode worker since %s"
,
terrstr
());
mmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"mnode-worker"
,
"initialized"
);
if
(
!
deployed
)
{
deployed
=
true
;
...
...
source/dnode/mgmt/mgmt_qnode/src/qmInt.c
浏览文件 @
7c588cc0
...
...
@@ -64,12 +64,14 @@ static int32_t qmOpen(SMgmtWrapper *pWrapper) {
qmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"qnode-impl"
,
"initialized"
);
if
(
qmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start qnode worker since %s"
,
terrstr
());
qmClose
(
pWrapper
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"qnode-worker"
,
"initialized"
);
dInfo
(
"qnode-mgmt is initialized"
);
return
0
;
...
...
source/dnode/mgmt/mgmt_snode/src/smInt.c
浏览文件 @
7c588cc0
...
...
@@ -60,11 +60,13 @@ int32_t smOpen(SMgmtWrapper *pWrapper) {
dError
(
"failed to open snode since %s"
,
terrstr
());
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"snode-impl"
,
"initialized"
);
if
(
smStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start snode worker since %s"
,
terrstr
());
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"snode-worker"
,
"initialized"
);
return
0
;
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
7c588cc0
...
...
@@ -130,7 +130,7 @@ static void *vmOpenVnodeFunc(void *param) {
char
stepDesc
[
TSDB_STEP_DESC_LEN
]
=
{
0
};
snprintf
(
stepDesc
,
TSDB_STEP_DESC_LEN
,
"vgId:%d, start to restore, %d of %d have been opened"
,
pCfg
->
vgId
,
pMgmt
->
state
.
openVnodes
,
pMgmt
->
state
.
totalVnodes
);
dmReportStartup
(
pDnode
,
"
open-vnodes
"
,
stepDesc
);
dmReportStartup
(
pDnode
,
"
vnode-open
"
,
stepDesc
);
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
...
...
@@ -298,25 +298,30 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
dError
(
"failed to init tfs since %s"
,
terrstr
());
goto
_OVER
;
}
dmReportStartup
(
pDnode
,
"vnode-tfs"
,
"initialized"
);
if
(
walInit
()
!=
0
)
{
dError
(
"failed to init wal since %s"
,
terrstr
());
goto
_OVER
;
}
dmReportStartup
(
pDnode
,
"vnode-wal"
,
"initialized"
);
if
(
vnodeInit
(
tsNumOfCommitThreads
)
!=
0
)
{
dError
(
"failed to init vnode since %s"
,
terrstr
());
goto
_OVER
;
}
dmReportStartup
(
pDnode
,
"vnode-commit"
,
"initialized"
);
if
(
vmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to init workers since %s"
,
terrstr
())
goto
_OVER
;
}
dmReportStartup
(
pDnode
,
"vnode-worker"
,
"initialized"
);
if
(
vmOpenVnodes
(
pMgmt
)
!=
0
)
{
dError
(
"failed to open vnode since %s"
,
terrstr
());
return
-
1
;
}
dmReportStartup
(
pDnode
,
"vnode-vnodes"
,
"initialized"
);
code
=
0
;
...
...
source/dnode/mnode/impl/src/mnode.c
浏览文件 @
7c588cc0
...
...
@@ -262,6 +262,7 @@ static int32_t mndExecSteps(SMnode *pMnode) {
return
-
1
;
}
else
{
mDebug
(
"%s is initialized"
,
pStep
->
name
);
tmsgReportStartup
(
pStep
->
name
,
"initialized"
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录