Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d2b8c5e4
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d2b8c5e4
编写于
3月 25, 2023
作者:
X
Xiaoyu Wang
提交者:
GitHub
3月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20524 from taosdata/fix/clusterid-isolation
fix: clusterid isolation
上级
95dd3e07
8d1224ce
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
0 deletion
+20
-0
include/util/taoserror.h
include/util/taoserror.h
+1
-0
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+9
-0
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+9
-0
source/libs/sync/src/syncRequestVote.c
source/libs/sync/src/syncRequestVote.c
+1
-0
未找到文件。
include/util/taoserror.h
浏览文件 @
d2b8c5e4
...
...
@@ -223,6 +223,7 @@ int32_t* taosGetErrno();
// #define TSDB_CODE_MND_NOT_READY TAOS_DEF_ERROR_CODE(0, 0x033C) // 2.x
// #define TSDB_CODE_MND_DNODE_ID_NOT_CONFIGUREDTAOS_DEF_ERROR_CODE(0, 0x033D) // 2.x
// #define TSDB_CODE_MND_DNODE_EP_NOT_CONFIGUREDTAOS_DEF_ERROR_CODE(0, 0x033E) // 2.x
#define TSDB_CODE_MND_DNODE_DIFF_CLUSTER TAOS_DEF_ERROR_CODE(0, 0x033F) // internal
// mnode-acct
#define TSDB_CODE_MND_ACCT_ALREADY_EXIST TAOS_DEF_ERROR_CODE(0, 0x0340)
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
d2b8c5e4
...
...
@@ -25,6 +25,7 @@
#include "mndUser.h"
#include "mndVgroup.h"
#include "tmisce.h"
#include "mndCluster.h"
#define TSDB_DNODE_VER_NUMBER 1
#define TSDB_DNODE_RESERVE_SIZE 64
...
...
@@ -366,6 +367,14 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
goto
_OVER
;
}
int64_t
clusterid
=
mndGetClusterId
(
pMnode
);
if
(
statusReq
.
clusterId
!=
0
&&
statusReq
.
clusterId
!=
clusterid
)
{
code
=
TSDB_CODE_MND_DNODE_DIFF_CLUSTER
;
mWarn
(
"dnode:%d, %s, its clusterid:%"
PRId64
" differ from current cluster:%"
PRId64
", code:0x%x"
,
statusReq
.
dnodeId
,
statusReq
.
dnodeEp
,
statusReq
.
clusterId
,
clusterid
,
code
);
goto
_OVER
;
}
if
(
statusReq
.
dnodeId
==
0
)
{
pDnode
=
mndAcquireDnodeByEp
(
pMnode
,
statusReq
.
dnodeEp
);
if
(
pDnode
==
NULL
)
{
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
d2b8c5e4
...
...
@@ -37,6 +37,7 @@
#include "syncVoteMgr.h"
#include "tglobal.h"
#include "tref.h"
#include "syncUtil.h"
static
void
syncNodeEqPingTimer
(
void
*
param
,
void
*
tmrId
);
static
void
syncNodeEqElectTimer
(
void
*
param
,
void
*
tmrId
);
...
...
@@ -2295,6 +2296,14 @@ int32_t syncNodeOnHeartbeat(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
int64_t
timeDiff
=
tsMs
-
pMsg
->
timeStamp
;
syncLogRecvHeartbeat
(
ths
,
pMsg
,
timeDiff
,
tbuf
);
if
(
!
syncNodeInRaftGroup
(
ths
,
&
pMsg
->
srcId
))
{
sWarn
(
"vgId:%d, drop heartbeat msg from dnode:%d, because it come from another cluster:%d, differ from current "
"cluster:%d"
,
ths
->
vgId
,
DID
(
&
(
pMsg
->
srcId
)),
CID
(
&
(
pMsg
->
srcId
)),
CID
(
&
(
ths
->
myRaftId
)));
return
0
;
}
SRpcMsg
rpcMsg
=
{
0
};
(
void
)
syncBuildHeartbeatReply
(
&
rpcMsg
,
ths
->
vgId
);
SyncTerm
currentTerm
=
raftStoreGetTerm
(
ths
);
...
...
source/libs/sync/src/syncRequestVote.c
浏览文件 @
d2b8c5e4
...
...
@@ -20,6 +20,7 @@
#include "syncRaftStore.h"
#include "syncUtil.h"
#include "syncVoteMgr.h"
#include "syncUtil.h"
// TLA+ Spec
// HandleRequestVoteRequest(i, j, m) ==
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录