Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
9abff317
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看板
提交
9abff317
编写于
12月 06, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2347
上级
555125af
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
16 deletion
+37
-16
src/dnode/src/dnodeEps.c
src/dnode/src/dnodeEps.c
+7
-0
src/dnode/src/dnodeMInfos.c
src/dnode/src/dnodeMInfos.c
+19
-8
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+6
-1
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+1
-1
src/vnode/src/vnodeCfg.c
src/vnode/src/vnodeCfg.c
+2
-3
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-2
未找到文件。
src/dnode/src/dnodeEps.c
浏览文件 @
9abff317
...
@@ -236,7 +236,14 @@ PRASE_EPS_OVER:
...
@@ -236,7 +236,14 @@ PRASE_EPS_OVER:
dnodeResetEps
(
eps
);
dnodeResetEps
(
eps
);
if
(
eps
)
free
(
eps
);
if
(
eps
)
free
(
eps
);
#if 0
dnodeUpdateEp(dnodeGetDnodeId(), tsLocalEp, tsLocalFqdn, &tsServerPort);
dnodeUpdateEp(dnodeGetDnodeId(), tsLocalEp, tsLocalFqdn, &tsServerPort);
#else
if
(
dnodeCheckEpChanged
(
dnodeGetDnodeId
(),
tsLocalEp
))
{
dError
(
"dnode:%d, localEp is changed to %s in dnodeEps.json and need reconfigured"
,
dnodeGetDnodeId
(),
tsLocalEp
);
return
-
1
;
}
#endif
terrno
=
0
;
terrno
=
0
;
return
0
;
return
0
;
...
...
src/dnode/src/dnodeMInfos.c
浏览文件 @
9abff317
...
@@ -157,12 +157,13 @@ static void dnodeResetMInfos(SMInfos *pMinfos) {
...
@@ -157,12 +157,13 @@ static void dnodeResetMInfos(SMInfos *pMinfos) {
}
}
static
int32_t
dnodeReadMInfos
()
{
static
int32_t
dnodeReadMInfos
()
{
int32_t
len
=
0
;
int32_t
len
=
0
;
int32_t
maxLen
=
2000
;
int32_t
maxLen
=
2000
;
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
cJSON
*
root
=
NULL
;
cJSON
*
root
=
NULL
;
FILE
*
fp
=
NULL
;
FILE
*
fp
=
NULL
;
SMInfos
minfos
=
{
0
};
SMInfos
minfos
=
{
0
};
bool
nodeChanged
=
false
;
char
file
[
TSDB_FILENAME_LEN
+
20
]
=
{
0
};
char
file
[
TSDB_FILENAME_LEN
+
20
]
=
{
0
};
sprintf
(
file
,
"%s/mnodeEpSet.json"
,
tsDnodeDir
);
sprintf
(
file
,
"%s/mnodeEpSet.json"
,
tsDnodeDir
);
...
@@ -221,14 +222,19 @@ static int32_t dnodeReadMInfos() {
...
@@ -221,14 +222,19 @@ static int32_t dnodeReadMInfos() {
dError
(
"failed to read mnodeEpSet.json, nodeId not found"
);
dError
(
"failed to read mnodeEpSet.json, nodeId not found"
);
goto
PARSE_MINFOS_OVER
;
goto
PARSE_MINFOS_OVER
;
}
}
minfos
.
mnodeInfos
[
i
].
mnodeId
=
nodeId
->
valueint
;
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
dError
(
"failed to read mnodeEpSet.json, nodeName not found"
);
dError
(
"failed to read mnodeEpSet.json, nodeName not found"
);
goto
PARSE_MINFOS_OVER
;
goto
PARSE_MINFOS_OVER
;
}
}
strncpy
(
minfos
.
mnodeInfos
[
i
].
mnodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
SMInfo
*
pMinfo
=
&
minfos
.
mnodeInfos
[
i
];
pMinfo
->
mnodeId
=
nodeId
->
valueint
;
tstrncpy
(
pMinfo
->
mnodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
bool
changed
=
dnodeCheckEpChanged
(
pMinfo
->
mnodeId
,
pMinfo
->
mnodeEp
);
if
(
changed
)
nodeChanged
=
changed
;
}
}
dInfo
(
"read file %s successed"
,
file
);
dInfo
(
"read file %s successed"
,
file
);
...
@@ -245,6 +251,11 @@ PARSE_MINFOS_OVER:
...
@@ -245,6 +251,11 @@ PARSE_MINFOS_OVER:
dnodeUpdateEp
(
mInfo
->
mnodeId
,
mInfo
->
mnodeEp
,
NULL
,
NULL
);
dnodeUpdateEp
(
mInfo
->
mnodeId
,
mInfo
->
mnodeEp
,
NULL
,
NULL
);
}
}
dnodeResetMInfos
(
&
minfos
);
dnodeResetMInfos
(
&
minfos
);
if
(
nodeChanged
)
{
dnodeWriteMInfos
();
}
return
0
;
return
0
;
}
}
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
9abff317
...
@@ -58,10 +58,10 @@ typedef struct {
...
@@ -58,10 +58,10 @@ typedef struct {
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
{
"tfile"
,
tfInit
,
tfCleanup
},
{
"tfile"
,
tfInit
,
tfCleanup
},
{
"rpc"
,
rpcInit
,
rpcCleanup
},
{
"rpc"
,
rpcInit
,
rpcCleanup
},
{
"globalcfg"
,
taosCheckGlobalCfg
,
NULL
},
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"dnodecfg"
,
dnodeInitCfg
,
dnodeCleanupCfg
},
{
"dnodecfg"
,
dnodeInitCfg
,
dnodeCleanupCfg
},
{
"dnodeeps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"dnodeeps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"globalcfg"
,
taosCheckGlobalCfg
,
NULL
},
{
"mnodeinfos"
,
dnodeInitMInfos
,
dnodeCleanupMInfos
},
{
"mnodeinfos"
,
dnodeInitMInfos
,
dnodeCleanupMInfos
},
{
"wal"
,
walInit
,
walCleanUp
},
{
"wal"
,
walInit
,
walCleanUp
},
{
"check"
,
dnodeInitCheck
,
dnodeCleanupCheck
},
// NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
{
"check"
,
dnodeInitCheck
,
dnodeCleanupCheck
},
// NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
9abff317
...
@@ -339,7 +339,12 @@ static int32_t dnodeOpenVnodes() {
...
@@ -339,7 +339,12 @@ static int32_t dnodeOpenVnodes() {
}
}
free
(
threads
);
free
(
threads
);
dInfo
(
"there are total vnodes:%d, openned:%d failed:%d"
,
numOfVnodes
,
openVnodes
,
failedVnodes
);
dInfo
(
"there are total vnodes:%d, openned:%d"
,
numOfVnodes
,
openVnodes
);
if
(
failedVnodes
!=
0
)
{
dError
(
"there are total vnodes:%d, failed:%d"
,
numOfVnodes
,
failedVnodes
);
return
-
1
;
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/sync/src/syncMain.c
浏览文件 @
9abff317
...
@@ -226,7 +226,7 @@ int64_t syncStart(const SSyncInfo *pInfo) {
...
@@ -226,7 +226,7 @@ int64_t syncStart(const SSyncInfo *pInfo) {
}
}
if
(
pNode
->
selfIndex
<
0
)
{
if
(
pNode
->
selfIndex
<
0
)
{
s
Info
(
"vgId:%d, this node is not configured"
,
pNode
->
vgId
);
s
Error
(
"vgId:%d, this node is not configured"
,
pNode
->
vgId
);
terrno
=
TSDB_CODE_SYN_INVALID_CONFIG
;
terrno
=
TSDB_CODE_SYN_INVALID_CONFIG
;
syncStop
(
pNode
->
rid
);
syncStop
(
pNode
->
rid
);
return
-
1
;
return
-
1
;
...
...
src/vnode/src/vnodeCfg.c
浏览文件 @
9abff317
...
@@ -242,9 +242,8 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
...
@@ -242,9 +242,8 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
}
}
tstrncpy
(
node
->
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
tstrncpy
(
node
->
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
if
(
!
nodeChanged
)
{
bool
changed
=
dnodeCheckEpChanged
(
node
->
nodeId
,
node
->
nodeEp
);
nodeChanged
=
dnodeCheckEpChanged
(
node
->
nodeId
,
node
->
nodeEp
);
if
(
changed
)
nodeChanged
=
changed
;
}
}
}
ret
=
TSDB_CODE_SUCCESS
;
ret
=
TSDB_CODE_SUCCESS
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
9abff317
...
@@ -362,9 +362,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
...
@@ -362,9 +362,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
pVnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
#else
#else
if
(
pVnode
->
sync
<=
0
)
{
if
(
pVnode
->
sync
<=
0
)
{
vError
(
"vgId:%d, failed to open sync
module
, replica:%d reason:%s"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
vError
(
"vgId:%d, failed to open sync, replica:%d reason:%s"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
tstrerror
(
terrno
));
tstrerror
(
terrno
));
vnodeRelease
(
pVnode
);
vnodeCleanUp
(
pVnode
);
vnodeCleanUp
(
pVnode
);
return
terrno
;
return
terrno
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录