Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
06b3e87a
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
06b3e87a
编写于
10月 31, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1663
上级
3f507c53
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
37 addition
and
21 deletion
+37
-21
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+0
-1
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+7
-7
src/common/src/tglobal.c
src/common/src/tglobal.c
+4
-2
src/dnode/src/dnodeEps.c
src/dnode/src/dnodeEps.c
+3
-0
src/dnode/src/dnodeMInfos.c
src/dnode/src/dnodeMInfos.c
+7
-3
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+9
-7
src/util/src/tconfig.c
src/util/src/tconfig.c
+5
-1
src/vnode/src/vnodeCfg.c
src/vnode/src/vnodeCfg.c
+2
-0
未找到文件。
src/client/src/tscSystem.c
浏览文件 @
06b3e87a
...
@@ -104,7 +104,6 @@ void taos_init_imp(void) {
...
@@ -104,7 +104,6 @@ void taos_init_imp(void) {
taosReadGlobalCfg
();
taosReadGlobalCfg
();
taosCheckGlobalCfg
();
taosCheckGlobalCfg
();
taosPrintGlobalCfg
();
tscDebug
(
"starting to initialize TAOS client ..."
);
tscDebug
(
"starting to initialize TAOS client ..."
);
tscDebug
(
"Local End Point is:%s"
,
tsLocalEp
);
tscDebug
(
"Local End Point is:%s"
,
tsLocalEp
);
...
...
src/common/inc/tglobal.h
浏览文件 @
06b3e87a
...
@@ -183,13 +183,13 @@ extern int32_t debugFlag;
...
@@ -183,13 +183,13 @@ extern int32_t debugFlag;
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
void
taosInitGlobalCfg
();
void
taosInitGlobalCfg
();
bool
taosCheckGlobalCfg
();
int32_t
taosCheckGlobalCfg
();
void
taosSetAllDebugFlag
();
void
taosSetAllDebugFlag
();
bool
taosCfgDynamicOptions
(
char
*
msg
);
bool
taosCfgDynamicOptions
(
char
*
msg
);
int
taosGetFqdnPortFromEp
(
const
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
int
taosGetFqdnPortFromEp
(
const
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
);
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeId
,
int32_t
*
dnodeId
);
bool
taosCheckBalanceCfgOptions
(
const
char
*
option
,
int32_t
*
vnodeId
,
int32_t
*
dnodeId
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
src/common/src/tglobal.c
浏览文件 @
06b3e87a
...
@@ -1316,7 +1316,7 @@ void taosInitGlobalCfg() {
...
@@ -1316,7 +1316,7 @@ void taosInitGlobalCfg() {
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
pthread_once
(
&
tsInitGlobalCfgOnce
,
doInitGlobalConfig
);
}
}
bool
taosCheckGlobalCfg
()
{
int32_t
taosCheckGlobalCfg
()
{
char
fqdn
[
TSDB_FQDN_LEN
];
char
fqdn
[
TSDB_FQDN_LEN
];
uint16_t
port
;
uint16_t
port
;
...
@@ -1375,7 +1375,9 @@ bool taosCheckGlobalCfg() {
...
@@ -1375,7 +1375,9 @@ bool taosCheckGlobalCfg() {
tsSyncPort
=
tsServerPort
+
TSDB_PORT_SYNC
;
tsSyncPort
=
tsServerPort
+
TSDB_PORT_SYNC
;
tsHttpPort
=
tsServerPort
+
TSDB_PORT_HTTP
;
tsHttpPort
=
tsServerPort
+
TSDB_PORT_HTTP
;
return
true
;
taosPrintGlobalCfg
();
return
0
;
}
}
int
taosGetFqdnPortFromEp
(
const
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
)
{
int
taosGetFqdnPortFromEp
(
const
char
*
ep
,
char
*
fqdn
,
uint16_t
*
port
)
{
...
...
src/dnode/src/dnodeEps.c
浏览文件 @
06b3e87a
...
@@ -87,6 +87,7 @@ bool dnodeCheckEpChanged(int32_t dnodeId, char *epstr) {
...
@@ -87,6 +87,7 @@ bool dnodeCheckEpChanged(int32_t dnodeId, char *epstr) {
char
epSaved
[
TSDB_EP_LEN
+
1
];
char
epSaved
[
TSDB_EP_LEN
+
1
];
snprintf
(
epSaved
,
TSDB_EP_LEN
,
"%s:%u"
,
ep
->
dnodeFqdn
,
ep
->
dnodePort
);
snprintf
(
epSaved
,
TSDB_EP_LEN
,
"%s:%u"
,
ep
->
dnodeFqdn
,
ep
->
dnodePort
);
changed
=
strcmp
(
epstr
,
epSaved
)
!=
0
;
changed
=
strcmp
(
epstr
,
epSaved
)
!=
0
;
tstrncpy
(
epstr
,
epSaved
,
TSDB_EP_LEN
);
}
}
pthread_mutex_unlock
(
&
tsEpsMutex
);
pthread_mutex_unlock
(
&
tsEpsMutex
);
return
changed
;
return
changed
;
...
@@ -235,6 +236,8 @@ PRASE_EPS_OVER:
...
@@ -235,6 +236,8 @@ PRASE_EPS_OVER:
dnodeResetEps
(
eps
);
dnodeResetEps
(
eps
);
if
(
eps
)
free
(
eps
);
if
(
eps
)
free
(
eps
);
dnodeUpdateEp
(
dnodeGetDnodeId
(),
tsLocalEp
,
tsLocalFqdn
,
&
tsServerPort
);
terrno
=
0
;
terrno
=
0
;
return
0
;
return
0
;
}
}
...
...
src/dnode/src/dnodeMInfos.c
浏览文件 @
06b3e87a
...
@@ -124,9 +124,9 @@ void dnodeGetEpSetForShell(SRpcEpSet *epSet) {
...
@@ -124,9 +124,9 @@ void dnodeGetEpSetForShell(SRpcEpSet *epSet) {
}
}
static
void
dnodePrintMInfos
(
SMnodeInfos
*
minfos
)
{
static
void
dnodePrintMInfos
(
SMnodeInfos
*
minfos
)
{
dInfo
(
"print mnode infos, mnodeNum:%d inUse:%d"
,
tsMInfos
.
mnodeNum
,
tsMInfos
.
inUse
);
dInfo
(
"print mnode infos, mnodeNum:%d inUse:%d"
,
minfos
->
mnodeNum
,
minfos
->
inUse
);
for
(
int32_t
i
=
0
;
i
<
tsMInfos
.
mnodeNum
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
minfos
->
mnodeNum
;
i
++
)
{
dInfo
(
"mnode index:%d, %s"
,
tsMInfos
.
mnodeInfos
[
i
].
mnodeId
,
tsMInfos
.
mnodeInfos
[
i
].
mnodeEp
);
dInfo
(
"mnode index:%d, %s"
,
minfos
->
mnodeInfos
[
i
].
mnodeId
,
minfos
->
mnodeInfos
[
i
].
mnodeEp
);
}
}
}
}
...
@@ -240,6 +240,10 @@ PARSE_MINFOS_OVER:
...
@@ -240,6 +240,10 @@ PARSE_MINFOS_OVER:
if
(
fp
!=
NULL
)
fclose
(
fp
);
if
(
fp
!=
NULL
)
fclose
(
fp
);
terrno
=
0
;
terrno
=
0
;
for
(
int32_t
i
=
0
;
i
<
minfos
.
mnodeNum
;
++
i
)
{
SMnodeInfo
*
mInfo
=
&
minfos
.
mnodeInfos
[
i
];
dnodeUpdateEp
(
mInfo
->
mnodeId
,
mInfo
->
mnodeEp
,
NULL
,
NULL
);
}
dnodeResetMInfos
(
&
minfos
);
dnodeResetMInfos
(
&
minfos
);
return
0
;
return
0
;
}
}
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
06b3e87a
...
@@ -54,9 +54,10 @@ typedef struct {
...
@@ -54,9 +54,10 @@ typedef struct {
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"eps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"dnodecfg"
,
dnodeInitCfg
,
dnodeCleanupCfg
},
{
"minfos"
,
dnodeInitMInfos
,
dnodeCleanupMInfos
},
{
"dnodeeps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"cfg"
,
dnodeInitCfg
,
dnodeCleanupCfg
},
{
"mnodeinfos"
,
dnodeInitMInfos
,
dnodeCleanupMInfos
},
{
"globalcfg"
,
taosCheckGlobalCfg
,
NULL
},
{
"check"
,
dnodeInitCheck
,
dnodeCleanupCheck
},
// NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{
"check"
,
dnodeInitCheck
,
dnodeCleanupCheck
},
// NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{
"vread"
,
dnodeInitVnodeRead
,
dnodeCleanupVnodeRead
},
{
"vread"
,
dnodeInitVnodeRead
,
dnodeCleanupVnodeRead
},
{
"vwrite"
,
dnodeInitVnodeWrite
,
dnodeCleanupVnodeWrite
},
{
"vwrite"
,
dnodeInitVnodeWrite
,
dnodeCleanupVnodeWrite
},
...
@@ -82,7 +83,9 @@ static int dnodeCreateDir(const char *dir) {
...
@@ -82,7 +83,9 @@ static int dnodeCreateDir(const char *dir) {
static
void
dnodeCleanupComponents
(
int32_t
stepId
)
{
static
void
dnodeCleanupComponents
(
int32_t
stepId
)
{
for
(
int32_t
i
=
stepId
;
i
>=
0
;
i
--
)
{
for
(
int32_t
i
=
stepId
;
i
>=
0
;
i
--
)
{
tsDnodeComponents
[
i
].
cleanup
();
if
(
tsDnodeComponents
[
i
].
cleanup
)
{
(
*
tsDnodeComponents
[
i
].
cleanup
)();
}
}
}
}
}
...
@@ -119,14 +122,13 @@ int32_t dnodeInitSystem() {
...
@@ -119,14 +122,13 @@ int32_t dnodeInitSystem() {
printf
(
"failed to init log file
\n
"
);
printf
(
"failed to init log file
\n
"
);
}
}
if
(
!
taosReadGlobalCfg
()
||
!
taosCheckGlobalCfg
()
)
{
if
(
!
taosReadGlobalCfg
())
{
taosPrintGlobalCfg
();
taosPrintGlobalCfg
();
dError
(
"TDengine read global config failed"
);
dError
(
"TDengine read global config failed"
);
return
-
1
;
return
-
1
;
}
}
taosPrintGlobalCfg
();
dInfo
(
"start to initialize TDengine
on %s"
,
tsLocalEp
);
dInfo
(
"start to initialize TDengine
"
);
if
(
dnodeInitComponents
()
!=
0
)
{
if
(
dnodeInitComponents
()
!=
0
)
{
return
-
1
;
return
-
1
;
...
...
src/util/src/tconfig.c
浏览文件 @
06b3e87a
...
@@ -355,7 +355,11 @@ bool taosReadGlobalCfg() {
...
@@ -355,7 +355,11 @@ bool taosReadGlobalCfg() {
fclose
(
fp
);
fclose
(
fp
);
taosTFree
(
line
);
taosTFree
(
line
);
if
(
debugFlag
&
DEBUG_TRACE
||
debugFlag
&
DEBUG_DEBUG
||
debugFlag
&
DEBUG_DUMP
)
{
taosSetAllDebugFlag
();
}
return
true
;
return
true
;
}
}
...
...
src/vnode/src/vnodeCfg.c
浏览文件 @
06b3e87a
...
@@ -72,6 +72,8 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
...
@@ -72,6 +72,8 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
char
file
[
TSDB_FILENAME_LEN
+
30
]
=
{
0
};
char
file
[
TSDB_FILENAME_LEN
+
30
]
=
{
0
};
sprintf
(
file
,
"%s/vnode%d/config.json"
,
tsVnodeDir
,
pVnode
->
vgId
);
sprintf
(
file
,
"%s/vnode%d/config.json"
,
tsVnodeDir
,
pVnode
->
vgId
);
vnodeMsg
.
cfg
.
vgId
=
pVnode
->
vgId
;
fp
=
fopen
(
file
,
"r"
);
fp
=
fopen
(
file
,
"r"
);
if
(
!
fp
)
{
if
(
!
fp
)
{
vError
(
"vgId:%d, failed to open vnode cfg file:%s to read, error:%s"
,
pVnode
->
vgId
,
file
,
strerror
(
errno
));
vError
(
"vgId:%d, failed to open vnode cfg file:%s to read, error:%s"
,
pVnode
->
vgId
,
file
,
strerror
(
errno
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录