Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6ed3c249
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看板
提交
6ed3c249
编写于
3月 30, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
587723c4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
27 deletion
+19
-27
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+1
-1
source/dnode/mgmt/main/exe/dndMain.c
source/dnode/mgmt/main/exe/dndMain.c
+1
-1
source/dnode/mgmt/main/inc/dnd.h
source/dnode/mgmt/main/inc/dnd.h
+4
-4
source/dnode/mgmt/main/src/dndInt.c
source/dnode/mgmt/main/src/dndInt.c
+5
-13
source/dnode/mgmt/main/src/dndObj.c
source/dnode/mgmt/main/src/dndObj.c
+7
-7
source/dnode/mgmt/vm/src/vmInt.c
source/dnode/mgmt/vm/src/vmInt.c
+1
-1
未找到文件。
include/dnode/mgmt/dnode.h
浏览文件 @
6ed3c249
...
...
@@ -46,7 +46,7 @@ typedef struct {
char
localFqdn
[
TSDB_FQDN_LEN
];
char
firstEp
[
TSDB_EP_LEN
];
char
secondEp
[
TSDB_EP_LEN
];
SDiskCfg
*
pD
isks
;
SDiskCfg
*
d
isks
;
int32_t
numOfDisks
;
int8_t
ntype
;
}
SDnodeOpt
;
...
...
source/dnode/mgmt/main/exe/dndMain.c
浏览文件 @
6ed3c249
...
...
@@ -126,7 +126,7 @@ static SDnodeOpt dndGetOpt() {
option
.
serverPort
=
tsServerPort
;
tstrncpy
(
option
.
localFqdn
,
tsLocalFqdn
,
sizeof
(
option
.
localFqdn
));
snprintf
(
option
.
localEp
,
sizeof
(
option
.
localEp
),
"%s:%u"
,
option
.
localFqdn
,
option
.
serverPort
);
option
.
pD
isks
=
tsDiskCfg
;
option
.
d
isks
=
tsDiskCfg
;
option
.
numOfDisks
=
tsDiskCfgNum
;
option
.
ntype
=
global
.
ntype
;
return
option
;
...
...
source/dnode/mgmt/main/inc/dnd.h
浏览文件 @
6ed3c249
...
...
@@ -99,7 +99,7 @@ typedef struct SMgmtWrapper {
void
*
pMgmt
;
SDnode
*
pDnode
;
NodeMsgFp
msgFps
[
TDMT_MAX
];
int
32_t
msgVgIds
[
TDMT_MAX
];
// Handle the case where the same message type is distributed to qnode or vnode
int
8_t
msgVgIds
[
TDMT_MAX
];
// Handle the case where the same message type is distributed to qnode or vnode
SMgmtFp
fp
;
}
SMgmtWrapper
;
...
...
@@ -119,7 +119,7 @@ typedef struct SDnode {
char
*
firstEp
;
char
*
secondEp
;
char
*
dataDir
;
SDiskCfg
*
pD
isks
;
SDiskCfg
*
d
isks
;
int32_t
numOfDisks
;
uint16_t
serverPort
;
bool
dropped
;
...
...
@@ -127,7 +127,7 @@ typedef struct SDnode {
EDndStatus
status
;
EDndEvent
event
;
SStartupReq
startup
;
TdFilePtr
pLockF
ile
;
TdFilePtr
lockf
ile
;
STransMgmt
trans
;
SMgmtWrapper
wrappers
[
NODE_MAX
];
}
SDnode
;
...
...
@@ -136,7 +136,7 @@ const char *dndNodeLogStr(ENodeType ntype);
const
char
*
dndNodeProcStr
(
ENodeType
ntype
);
EDndStatus
dndGetStatus
(
SDnode
*
pDnode
);
void
dndSetStatus
(
SDnode
*
pDnode
,
EDndStatus
stat
);
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
int32_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int32
_t
vgId
);
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
tmsg_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int8
_t
vgId
);
void
dndReportStartup
(
SDnode
*
pDnode
,
const
char
*
pName
,
const
char
*
pDesc
);
void
dndSendMonitorReport
(
SDnode
*
pDnode
);
...
...
source/dnode/mgmt/main/src/dndInt.c
浏览文件 @
6ed3c249
...
...
@@ -20,7 +20,7 @@
static
int8_t
once
=
DND_ENV_INIT
;
int32_t
dndInit
()
{
d
Info
(
"start to init dnode env"
);
d
Debug
(
"start to init dnode env"
);
if
(
atomic_val_compare_exchange_8
(
&
once
,
DND_ENV_INIT
,
DND_ENV_READY
)
!=
DND_ENV_INIT
)
{
terrno
=
TSDB_CODE_REPEAT_INIT
;
dError
(
"failed to init dnode env since %s"
,
terrstr
());
...
...
@@ -31,12 +31,6 @@ int32_t dndInit() {
taosBlockSIGPIPE
();
taosResolveCRC
();
if
(
rpcInit
()
!=
0
)
{
dError
(
"failed to init rpc since %s"
,
terrstr
());
dndCleanup
();
return
-
1
;
}
SMonCfg
monCfg
=
{
0
};
monCfg
.
maxLogs
=
tsMonitorMaxLogs
;
monCfg
.
port
=
tsMonitorPort
;
...
...
@@ -44,29 +38,27 @@ int32_t dndInit() {
monCfg
.
comp
=
tsMonitorComp
;
if
(
monInit
(
&
monCfg
)
!=
0
)
{
dError
(
"failed to init monitor since %s"
,
terrstr
());
dndCleanup
();
return
-
1
;
}
d
Info
(
"dnode env is initialized"
);
d
Debug
(
"dnode env is initialized"
);
return
0
;
}
void
dndCleanup
()
{
d
Info
(
"start to cleanup dnode env"
);
d
Debug
(
"start to cleanup dnode env"
);
if
(
atomic_val_compare_exchange_8
(
&
once
,
DND_ENV_READY
,
DND_ENV_CLEANUP
)
!=
DND_ENV_READY
)
{
dError
(
"dnode env is already cleaned up"
);
return
;
}
monCleanup
();
rpcCleanup
();
walCleanUp
();
taosStopCacheRefreshWorker
();
d
Info
(
"dnode env is cleaned up"
);
d
Debug
(
"dnode env is cleaned up"
);
}
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
int32_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int32
_t
vgId
)
{
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
tmsg_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int8
_t
vgId
)
{
pWrapper
->
msgFps
[
TMSG_INDEX
(
msgType
)]
=
nodeMsgFp
;
pWrapper
->
msgVgIds
[
TMSG_INDEX
(
msgType
)]
=
vgId
;
}
...
...
source/dnode/mgmt/main/src/dndObj.c
浏览文件 @
6ed3c249
...
...
@@ -24,7 +24,7 @@ static int32_t dndInitMemory(SDnode *pDnode, const SDnodeOpt *pOption) {
pDnode
->
localFqdn
=
strdup
(
pOption
->
localFqdn
);
pDnode
->
firstEp
=
strdup
(
pOption
->
firstEp
);
pDnode
->
secondEp
=
strdup
(
pOption
->
secondEp
);
pDnode
->
pDisks
=
pOption
->
pD
isks
;
pDnode
->
disks
=
pOption
->
d
isks
;
pDnode
->
numOfDisks
=
pOption
->
numOfDisks
;
pDnode
->
ntype
=
pOption
->
ntype
;
pDnode
->
rebootTime
=
taosGetTimestampMs
();
...
...
@@ -42,10 +42,10 @@ static void dndClearMemory(SDnode *pDnode) {
SMgmtWrapper
*
pMgmt
=
&
pDnode
->
wrappers
[
n
];
taosMemoryFreeClear
(
pMgmt
->
path
);
}
if
(
pDnode
->
pLockF
ile
!=
NULL
)
{
taosUnLockFile
(
pDnode
->
pLockF
ile
);
taosCloseFile
(
&
pDnode
->
pLockF
ile
);
pDnode
->
pLockF
ile
=
NULL
;
if
(
pDnode
->
lockf
ile
!=
NULL
)
{
taosUnLockFile
(
pDnode
->
lockf
ile
);
taosCloseFile
(
&
pDnode
->
lockf
ile
);
pDnode
->
lockf
ile
=
NULL
;
}
taosMemoryFreeClear
(
pDnode
->
localEp
);
taosMemoryFreeClear
(
pDnode
->
localFqdn
);
...
...
@@ -73,8 +73,8 @@ SDnode *dndCreate(const SDnodeOpt *pOption) {
}
dndSetStatus
(
pDnode
,
DND_STAT_INIT
);
pDnode
->
pLockF
ile
=
dndCheckRunning
(
pDnode
->
dataDir
);
if
(
pDnode
->
pLockF
ile
==
NULL
)
{
pDnode
->
lockf
ile
=
dndCheckRunning
(
pDnode
->
dataDir
);
if
(
pDnode
->
lockf
ile
==
NULL
)
{
goto
_OVER
;
}
...
...
source/dnode/mgmt/vm/src/vmInt.c
浏览文件 @
6ed3c249
...
...
@@ -285,7 +285,7 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) {
tstrncpy
(
dCfg
.
dir
,
pDnode
->
dataDir
,
TSDB_FILENAME_LEN
);
dCfg
.
level
=
0
;
dCfg
.
primary
=
1
;
SDiskCfg
*
pDisks
=
pDnode
->
pD
isks
;
SDiskCfg
*
pDisks
=
pDnode
->
d
isks
;
int32_t
numOfDisks
=
pDnode
->
numOfDisks
;
if
(
numOfDisks
<=
0
||
pDisks
==
NULL
)
{
pDisks
=
&
dCfg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录