Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
89a19fdb
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看板
提交
89a19fdb
编写于
11月 01, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile errors
上级
0dddcdfb
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
30 addition
and
30 deletion
+30
-30
source/dnode/mgmt/inc/dnodeDnode.h
source/dnode/mgmt/inc/dnodeDnode.h
+2
-2
source/dnode/mgmt/inc/dnodeVnodes.h
source/dnode/mgmt/inc/dnodeVnodes.h
+2
-2
source/dnode/mgmt/src/dnodeConfig.c
source/dnode/mgmt/src/dnodeConfig.c
+1
-1
source/dnode/mgmt/src/dnodeDnode.c
source/dnode/mgmt/src/dnodeDnode.c
+13
-13
source/dnode/mgmt/src/dnodeInt.c
source/dnode/mgmt/src/dnodeInt.c
+12
-12
未找到文件。
source/dnode/mgmt/inc/dnodeDnode.h
浏览文件 @
89a19fdb
...
...
@@ -21,8 +21,8 @@ extern "C" {
#endif
#include "dnodeInt.h"
int32_t
dnodeInit
Msg
();
void
dnodeCleanup
Msg
();
int32_t
dnodeInit
Dnode
();
void
dnodeCleanup
Dnode
();
void
dnodeProcessStatusRsp
(
SRpcMsg
*
pMsg
);
void
dnodeProcessStartupReq
(
SRpcMsg
*
pMsg
);
void
dnodeProcessConfigDnodeReq
(
SRpcMsg
*
pMsg
);
...
...
source/dnode/mgmt/inc/dnodeVnodes.h
浏览文件 @
89a19fdb
...
...
@@ -21,8 +21,8 @@ extern "C" {
#endif
#include "dnodeInt.h"
int32_t
dnodeInit
Msg
();
void
dnodeCleanup
Msg
();
int32_t
dnodeInit
Dnode
();
void
dnodeCleanup
Dnode
();
void
dnodeProcessStatusRsp
(
SRpcMsg
*
pMsg
);
void
dnodeProcessStartupReq
(
SRpcMsg
*
pMsg
);
void
dnodeProcessCreateMnodeReq
(
SRpcMsg
*
pMsg
);
...
...
source/dnode/mgmt/src/dnodeConfig.c
浏览文件 @
89a19fdb
...
...
@@ -30,7 +30,7 @@ static struct {
pthread_mutex_t
mutex
;
}
tsConfig
;
v
static
oid
dnodeGetEpSetForPeer
(
SRpcEpSet
*
epSet
)
{
void
dnodeGetEpSetForPeer
(
SRpcEpSet
*
epSet
)
{
pthread_mutex_lock
(
&
tsConfig
.
mutex
);
*
epSet
=
tsConfig
.
mnodeEpSetForPeer
;
pthread_mutex_unlock
(
&
tsConfig
.
mutex
);
...
...
source/dnode/mgmt/src/dnodeDnode.c
浏览文件 @
89a19fdb
...
...
@@ -25,7 +25,7 @@ static struct {
pthread_t
*
threadId
;
bool
stop
;
uint32_t
rebootTime
;
}
ts
Msg
;
}
ts
Dnode
;
static
void
dnodeSendStatusMsg
()
{
int32_t
contLen
=
sizeof
(
SStatusMsg
)
+
TSDB_MAX_VNODES
*
sizeof
(
SVnodeLoad
);
...
...
@@ -39,7 +39,7 @@ static void dnodeSendStatusMsg() {
pStatus
->
dnodeId
=
htonl
(
dnodeGetDnodeId
());
tstrncpy
(
pStatus
->
dnodeEp
,
tsLocalEp
,
TSDB_EP_LEN
);
pStatus
->
clusterId
=
htobe64
(
dnodeGetClusterId
());
pStatus
->
lastReboot
=
htonl
(
ts
Msg
.
rebootTime
);
pStatus
->
lastReboot
=
htonl
(
ts
Dnode
.
rebootTime
);
pStatus
->
numOfCores
=
htonl
(
tsNumOfCores
);
pStatus
->
diskAvailable
=
tsAvailDataDirGB
;
...
...
@@ -93,17 +93,17 @@ void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
static
void
*
dnodeThreadRoutine
(
void
*
param
)
{
int32_t
ms
=
tsStatusInterval
*
1000
;
while
(
!
ts
Msg
.
stop
)
{
while
(
!
ts
Dnode
.
stop
)
{
taosMsleep
(
ms
);
dnodeSendStatusMsg
();
}
}
int32_t
dnodeInit
Msg
()
{
ts
Msg
.
stop
=
false
;
ts
Msg
.
rebootTime
=
taosGetTimestampSec
();
ts
Msg
.
threadId
=
taosCreateThread
(
dnodeThreadRoutine
,
NULL
);
if
(
ts
Msg
.
threadId
==
NULL
)
{
int32_t
dnodeInit
Dnode
()
{
ts
Dnode
.
stop
=
false
;
ts
Dnode
.
rebootTime
=
taosGetTimestampSec
();
ts
Dnode
.
threadId
=
taosCreateThread
(
dnodeThreadRoutine
,
NULL
);
if
(
ts
Dnode
.
threadId
==
NULL
)
{
return
-
1
;
}
...
...
@@ -111,11 +111,11 @@ int32_t dnodeInitMsg() {
return
0
;
}
void
dnodeCleanup
Msg
()
{
if
(
ts
Msg
.
threadId
!=
NULL
)
{
ts
Msg
.
stop
=
true
;
taosDestoryThread
(
ts
Msg
.
threadId
);
ts
Msg
.
threadId
=
NULL
;
void
dnodeCleanup
Dnode
()
{
if
(
ts
Dnode
.
threadId
!=
NULL
)
{
ts
Dnode
.
stop
=
true
;
taosDestoryThread
(
ts
Dnode
.
threadId
);
ts
Dnode
.
threadId
=
NULL
;
}
dInfo
(
"dnode msg is cleanuped"
);
...
...
source/dnode/mgmt/src/dnodeInt.c
浏览文件 @
89a19fdb
...
...
@@ -31,27 +31,27 @@ static struct {
EDnStat
runStatus
;
SStartupStep
startup
;
SSteps
*
steps
;
}
ts
Dnode
;
}
ts
Int
;
EDnStat
dnodeGetRunStat
()
{
return
ts
Dnode
.
runStatus
;
}
EDnStat
dnodeGetRunStat
()
{
return
ts
Int
.
runStatus
;
}
void
dnodeSetRunStat
(
EDnStat
stat
)
{
ts
Dnode
.
runStatus
=
stat
;
}
void
dnodeSetRunStat
(
EDnStat
stat
)
{
ts
Int
.
runStatus
=
stat
;
}
void
dnodeReportStartup
(
char
*
name
,
char
*
desc
)
{
SStartupStep
*
startup
=
&
ts
Dnode
.
startup
;
SStartupStep
*
startup
=
&
ts
Int
.
startup
;
tstrncpy
(
startup
->
name
,
name
,
strlen
(
startup
->
name
));
tstrncpy
(
startup
->
desc
,
desc
,
strlen
(
startup
->
desc
));
startup
->
finished
=
0
;
}
static
void
dnodeReportStartupFinished
(
char
*
name
,
char
*
desc
)
{
SStartupStep
*
startup
=
&
ts
Dnode
.
startup
;
SStartupStep
*
startup
=
&
ts
Int
.
startup
;
tstrncpy
(
startup
->
name
,
name
,
strlen
(
startup
->
name
));
tstrncpy
(
startup
->
desc
,
desc
,
strlen
(
startup
->
desc
));
startup
->
finished
=
1
;
}
void
dnodeGetStartup
(
SStartupStep
*
pStep
)
{
memcpy
(
pStep
,
&
ts
Dnode
.
startup
,
sizeof
(
SStartupStep
));
}
void
dnodeGetStartup
(
SStartupStep
*
pStep
)
{
memcpy
(
pStep
,
&
ts
Int
.
startup
,
sizeof
(
SStartupStep
));
}
static
int32_t
dnodeInitVnode
()
{
return
vnodeInit
();
...
...
@@ -72,7 +72,7 @@ static int32_t dnodeInitMnode() {
static
int32_t
dnodeInitTfs
()
{}
static
int32_t
dnodeInitMain
()
{
ts
Dnode
.
runStatus
=
DN_RUN_STAT_STOPPED
;
ts
Int
.
runStatus
=
DN_RUN_STAT_STOPPED
;
tscEmbedded
=
1
;
taosIgnSIGPIPE
();
taosBlockSIGPIPE
();
...
...
@@ -175,10 +175,10 @@ int32_t dnodeInit() {
taosStepAdd
(
steps
,
"dnode-vnode"
,
dnodeInitVnode
,
vnodeCleanup
);
taosStepAdd
(
steps
,
"dnode-mnode"
,
dnodeInitMnode
,
mnodeCleanup
);
taosStepAdd
(
steps
,
"dnode-trans"
,
dnodeInitTrans
,
dnodeCleanupTrans
);
taosStepAdd
(
steps
,
"dnode-msg"
,
dnodeInit
Msg
,
dnodeCleanupMsg
);
taosStepAdd
(
steps
,
"dnode-msg"
,
dnodeInit
Dnode
,
dnodeCleanupDnode
);
ts
Dnode
.
steps
=
steps
;
taosStepExec
(
ts
Dnode
.
steps
);
ts
Int
.
steps
=
steps
;
taosStepExec
(
ts
Int
.
steps
);
dnodeSetRunStat
(
DN_RUN_STAT_RUNNING
);
dnodeReportStartupFinished
(
"TDengine"
,
"initialized successfully"
);
...
...
@@ -190,8 +190,8 @@ int32_t dnodeInit() {
void
dnodeCleanup
()
{
if
(
dnodeGetRunStat
()
!=
DN_RUN_STAT_STOPPED
)
{
dnodeSetRunStat
(
DN_RUN_STAT_STOPPED
);
taosStepCleanup
(
ts
Dnode
.
steps
);
ts
Dnode
.
steps
=
NULL
;
taosStepCleanup
(
ts
Int
.
steps
);
ts
Int
.
steps
=
NULL
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录