Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
888e81ac
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看板
提交
888e81ac
编写于
10月 08, 2020
作者:
F
freemine
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/develop' into odbc
上级
04517568
68753218
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
32 addition
and
23 deletion
+32
-23
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+18
-2
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+10
-13
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+1
-0
src/inc/dnode.h
src/inc/dnode.h
+1
-1
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-6
tests/script/unique/mnode/mgmt23.sim
tests/script/unique/mnode/mgmt23.sim
+1
-1
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
888e81ac
...
@@ -468,8 +468,24 @@ void dnodeUpdateMnodeEpSetForPeer(SRpcEpSet *pEpSet) {
...
@@ -468,8 +468,24 @@ void dnodeUpdateMnodeEpSetForPeer(SRpcEpSet *pEpSet) {
if
(
!
mnodeIsRunning
())
{
if
(
!
mnodeIsRunning
())
{
if
(
strcmp
(
pEpSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
pEpSet
->
port
[
i
]
==
tsServerPort
)
{
if
(
strcmp
(
pEpSet
->
fqdn
[
i
],
tsLocalFqdn
)
==
0
&&
pEpSet
->
port
[
i
]
==
tsServerPort
)
{
dInfo
(
"mnode index:%d %s:%u should work as master"
,
i
,
pEpSet
->
fqdn
[
i
],
pEpSet
->
port
[
i
]);
dInfo
(
"mnode index:%d %s:%u should work as mnode"
,
i
,
pEpSet
->
fqdn
[
i
],
pEpSet
->
port
[
i
]);
sdbUpdateSync
();
bool
find
=
false
;
for
(
int
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
++
i
)
{
if
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
==
dnodeGetDnodeId
())
{
dInfo
(
"localEp found in mnode infos"
);
find
=
true
;
break
;
}
}
if
(
!
find
)
{
dInfo
(
"localEp not found in mnode infos, will set into mnode infos"
);
tstrncpy
(
tsDMnodeInfos
.
nodeInfos
[
tsDMnodeInfos
.
nodeNum
].
nodeEp
,
tsLocalEp
,
TSDB_EP_LEN
);
tsDMnodeInfos
.
nodeInfos
[
tsDMnodeInfos
.
nodeNum
].
nodeId
=
dnodeGetDnodeId
();
tsDMnodeInfos
.
nodeNum
++
;
}
dnodeStartMnode
();
}
}
}
}
}
}
...
...
src/dnode/src/dnodeModule.c
浏览文件 @
888e81ac
...
@@ -146,19 +146,16 @@ void dnodeProcessModuleStatus(uint32_t moduleStatus) {
...
@@ -146,19 +146,16 @@ void dnodeProcessModuleStatus(uint32_t moduleStatus) {
}
}
}
}
bool
dnodeCheckMnodeStarting
()
{
bool
dnodeStartMnode
()
{
if
(
tsModuleStatus
&
(
1
<<
TSDB_MOD_MNODE
))
return
false
;
if
(
tsModuleStatus
&
(
1
<<
TSDB_MOD_MNODE
))
{
dDebug
(
"mnode module is already started, module status:%d"
,
tsModuleStatus
);
SDMMnodeInfos
*
mnodes
=
dnodeGetMnodeInfos
();
return
false
;
for
(
int32_t
i
=
0
;
i
<
mnodes
->
nodeNum
;
++
i
)
{
SDMMnodeInfo
*
node
=
&
mnodes
->
nodeInfos
[
i
];
if
(
node
->
nodeId
==
dnodeGetDnodeId
())
{
uint32_t
moduleStatus
=
tsModuleStatus
|
(
1
<<
TSDB_MOD_MNODE
);
dInfo
(
"start mnode module, module status:%d, new status:%d"
,
tsModuleStatus
,
moduleStatus
);
dnodeProcessModuleStatus
(
moduleStatus
);
return
true
;
}
}
}
return
false
;
uint32_t
moduleStatus
=
tsModuleStatus
|
(
1
<<
TSDB_MOD_MNODE
);
dInfo
(
"start mnode module, module status:%d, new status:%d"
,
tsModuleStatus
,
moduleStatus
);
dnodeProcessModuleStatus
(
moduleStatus
);
sdbUpdateSync
();
return
true
;
}
}
src/dnode/src/dnodeVRead.c
浏览文件 @
888e81ac
...
@@ -187,6 +187,7 @@ void dnodeSendRpcReadRsp(void *pVnode, SReadMsg *pRead, int32_t code) {
...
@@ -187,6 +187,7 @@ void dnodeSendRpcReadRsp(void *pVnode, SReadMsg *pRead, int32_t code) {
}
}
void
dnodeDispatchNonRspMsg
(
void
*
pVnode
,
SReadMsg
*
pRead
,
int32_t
code
)
{
void
dnodeDispatchNonRspMsg
(
void
*
pVnode
,
SReadMsg
*
pRead
,
int32_t
code
)
{
rpcFreeCont
(
pRead
->
rpcMsg
.
pCont
);
vnodeRelease
(
pVnode
);
vnodeRelease
(
pVnode
);
return
;
return
;
}
}
...
...
src/inc/dnode.h
浏览文件 @
888e81ac
...
@@ -43,7 +43,7 @@ void dnodeGetMnodeEpSetForPeer(void *epSet);
...
@@ -43,7 +43,7 @@ void dnodeGetMnodeEpSetForPeer(void *epSet);
void
dnodeGetMnodeEpSetForShell
(
void
*
epSet
);
void
dnodeGetMnodeEpSetForShell
(
void
*
epSet
);
void
*
dnodeGetMnodeInfos
();
void
*
dnodeGetMnodeInfos
();
int32_t
dnodeGetDnodeId
();
int32_t
dnodeGetDnodeId
();
bool
dnode
CheckMnodeStarting
();
bool
dnode
StartMnode
();
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpcEpSet
*
epSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnode
(
SRpcEpSet
*
epSet
,
SRpcMsg
*
rpcMsg
);
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
888e81ac
...
@@ -91,7 +91,6 @@ typedef struct {
...
@@ -91,7 +91,6 @@ typedef struct {
}
SSdbWriteWorkerPool
;
}
SSdbWriteWorkerPool
;
extern
void
*
tsMnodeTmr
;
extern
void
*
tsMnodeTmr
;
static
void
*
tsUpdateSyncTmr
;
static
SSdbObject
tsSdbObj
=
{
0
};
static
SSdbObject
tsSdbObj
=
{
0
};
static
taos_qset
tsSdbWriteQset
;
static
taos_qset
tsSdbWriteQset
;
static
taos_qall
tsSdbWriteQall
;
static
taos_qall
tsSdbWriteQall
;
...
@@ -298,16 +297,12 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
...
@@ -298,16 +297,12 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
taosFreeQitem
(
pOper
);
taosFreeQitem
(
pOper
);
}
}
static
void
sdbUpdateSyncTmrFp
(
void
*
param
,
void
*
tmrId
)
{
sdbUpdateSync
();
}
void
sdbUpdateSync
()
{
void
sdbUpdateSync
()
{
if
(
!
mnodeIsRunning
())
{
if
(
!
mnodeIsRunning
())
{
mDebug
(
"mnode not start yet, update sync info later"
);
mDebug
(
"mnode not start yet, update sync info later"
);
if
(
dnodeCheckMnodeStarting
())
{
taosTmrReset
(
sdbUpdateSyncTmrFp
,
1000
,
NULL
,
tsMnodeTmr
,
&
tsUpdateSyncTmr
);
}
return
;
return
;
}
}
mDebug
(
"update sync info in sdb"
);
mDebug
(
"update sync info in sdb"
);
SSyncCfg
syncCfg
=
{
0
};
SSyncCfg
syncCfg
=
{
0
};
...
...
tests/script/unique/mnode/mgmt23.sim
浏览文件 @
888e81ac
...
@@ -65,7 +65,7 @@ endi
...
@@ -65,7 +65,7 @@ endi
print ============== step4
print ============== step4
sql drop dnode $hostname2
sql drop dnode $hostname2
sleep 1
6
000
sleep 1
0
000
sql show mnodes
sql show mnodes
$dnode1Role = $data2_1
$dnode1Role = $data2_1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录