Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
80ea523c
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看板
提交
80ea523c
编写于
8月 01, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into 3
上级
337e20ce
528a6890
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
2 addition
and
47 deletion
+2
-47
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+1
-15
source/libs/sync/src/syncAppendEntriesReply.c
source/libs/sync/src/syncAppendEntriesReply.c
+0
-10
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+1
-22
未找到文件。
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
80ea523c
...
@@ -416,7 +416,7 @@ int32_t mndStart(SMnode *pMnode) {
...
@@ -416,7 +416,7 @@ int32_t mndStart(SMnode *pMnode) {
}
}
mndSetRestore
(
pMnode
,
true
);
mndSetRestore
(
pMnode
,
true
);
}
}
grantReset
(
pMnode
,
TSDB_GRANT_ALL
,
0
);
grantReset
(
pMnode
,
TSDB_GRANT_ALL
,
0
);
return
mndInitTimer
(
pMnode
);
return
mndInitTimer
(
pMnode
);
...
@@ -446,20 +446,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
...
@@ -446,20 +446,6 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
return
-
1
;
return
-
1
;
}
}
do
{
char
*
syncNodeStr
=
sync2SimpleStr
(
pMgmt
->
sync
);
static
int64_t
mndTick
=
0
;
if
(
++
mndTick
%
10
==
1
)
{
mTrace
(
"vgId:%d, sync trace msg:%s, %s"
,
syncGetVgId
(
pMgmt
->
sync
),
TMSG_INFO
(
pMsg
->
msgType
),
syncNodeStr
);
}
if
(
gRaftDetailLog
)
{
char
logBuf
[
512
]
=
{
0
};
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"==mndProcessSyncMsg== msgType:%d, syncNode: %s"
,
pMsg
->
msgType
,
syncNodeStr
);
syncRpcMsgLog2
(
logBuf
,
pMsg
);
}
taosMemoryFree
(
syncNodeStr
);
}
while
(
0
);
// ToDo: ugly! use function pointer
// ToDo: ugly! use function pointer
if
(
syncNodeStrategy
(
pSyncNode
)
==
SYNC_STRATEGY_STANDARD_SNAPSHOT
)
{
if
(
syncNodeStrategy
(
pSyncNode
)
==
SYNC_STRATEGY_STANDARD_SNAPSHOT
)
{
if
(
pMsg
->
msgType
==
TDMT_SYNC_TIMEOUT
)
{
if
(
pMsg
->
msgType
==
TDMT_SYNC_TIMEOUT
)
{
...
...
source/libs/sync/src/syncAppendEntriesReply.c
浏览文件 @
80ea523c
...
@@ -335,10 +335,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
...
@@ -335,10 +335,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
// nextIndex' = [nextIndex EXCEPT ![i][j] = m.mmatchIndex + 1]
// nextIndex' = [nextIndex EXCEPT ![i][j] = m.mmatchIndex + 1]
syncIndexMgrSetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
),
pMsg
->
matchIndex
+
1
);
syncIndexMgrSetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
),
pMsg
->
matchIndex
+
1
);
if
(
gRaftDetailLog
)
{
sTrace
(
"update next match, index:%"
PRId64
", success:%d"
,
pMsg
->
matchIndex
+
1
,
pMsg
->
success
);
}
// matchIndex' = [matchIndex EXCEPT ![i][j] = m.mmatchIndex]
// matchIndex' = [matchIndex EXCEPT ![i][j] = m.mmatchIndex]
syncIndexMgrSetIndex
(
ths
->
pMatchIndex
,
&
(
pMsg
->
srcId
),
pMsg
->
matchIndex
);
syncIndexMgrSetIndex
(
ths
->
pMatchIndex
,
&
(
pMsg
->
srcId
),
pMsg
->
matchIndex
);
...
@@ -349,9 +345,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
...
@@ -349,9 +345,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
}
else
{
}
else
{
SyncIndex
nextIndex
=
syncIndexMgrGetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
));
SyncIndex
nextIndex
=
syncIndexMgrGetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
));
if
(
gRaftDetailLog
)
{
sTrace
(
"update next index not match, begin, index:%"
PRId64
", success:%d"
,
nextIndex
,
pMsg
->
success
);
}
// notice! int64, uint64
// notice! int64, uint64
if
(
nextIndex
>
SYNC_INDEX_BEGIN
)
{
if
(
nextIndex
>
SYNC_INDEX_BEGIN
)
{
...
@@ -393,9 +386,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
...
@@ -393,9 +386,6 @@ int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntries
}
}
syncIndexMgrSetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
),
nextIndex
);
syncIndexMgrSetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
),
nextIndex
);
if
(
gRaftDetailLog
)
{
sTrace
(
"update next index not match, end, index:%"
PRId64
", success:%d"
,
nextIndex
,
pMsg
->
success
);
}
}
}
SyncIndex
afterNextIndex
=
syncIndexMgrGetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
));
SyncIndex
afterNextIndex
=
syncIndexMgrGetIndex
(
ths
->
pNextIndex
,
&
(
pMsg
->
srcId
));
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
80ea523c
...
@@ -88,10 +88,6 @@ int64_t syncOpen(const SSyncInfo* pSyncInfo) {
...
@@ -88,10 +88,6 @@ int64_t syncOpen(const SSyncInfo* pSyncInfo) {
SSyncNode
*
pSyncNode
=
syncNodeOpen
(
pSyncInfo
);
SSyncNode
*
pSyncNode
=
syncNodeOpen
(
pSyncInfo
);
ASSERT
(
pSyncNode
!=
NULL
);
ASSERT
(
pSyncNode
!=
NULL
);
if
(
gRaftDetailLog
)
{
syncNodeLog2
(
"syncNodeOpen open success"
,
pSyncNode
);
}
pSyncNode
->
rid
=
taosAddRef
(
tsNodeRefId
,
pSyncNode
);
pSyncNode
->
rid
=
taosAddRef
(
tsNodeRefId
,
pSyncNode
);
if
(
pSyncNode
->
rid
<
0
)
{
if
(
pSyncNode
->
rid
<
0
)
{
syncFreeNode
(
pSyncNode
);
syncFreeNode
(
pSyncNode
);
...
@@ -245,11 +241,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) {
...
@@ -245,11 +241,7 @@ int32_t syncReconfig(int64_t rid, const SSyncCfg* pNewCfg) {
return
-
1
;
return
-
1
;
}
}
char
*
newconfig
=
syncCfg2Str
((
SSyncCfg
*
)
pNewCfg
);
char
*
newconfig
=
syncCfg2Str
((
SSyncCfg
*
)
pNewCfg
);
if
(
gRaftDetailLog
)
{
sInfo
(
"==syncReconfig== newconfig:%s"
,
newconfig
);
}
int32_t
ret
=
0
;
int32_t
ret
=
0
;
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
...
@@ -912,12 +904,6 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
...
@@ -912,12 +904,6 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pOldSyncInfo) {
ASSERT
(
pSyncNode
->
pRaftCfg
!=
NULL
);
ASSERT
(
pSyncNode
->
pRaftCfg
!=
NULL
);
pSyncInfo
->
syncCfg
=
pSyncNode
->
pRaftCfg
->
cfg
;
pSyncInfo
->
syncCfg
=
pSyncNode
->
pRaftCfg
->
cfg
;
if
(
gRaftDetailLog
)
{
char
*
seralized
=
raftCfg2Str
(
pSyncNode
->
pRaftCfg
);
sInfo
(
"syncNodeOpen update config :%s"
,
seralized
);
taosMemoryFree
(
seralized
);
}
raftCfgClose
(
pSyncNode
->
pRaftCfg
);
raftCfgClose
(
pSyncNode
->
pRaftCfg
);
}
}
...
@@ -1348,13 +1334,6 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp
...
@@ -1348,13 +1334,6 @@ int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRp
SEpSet
epSet
;
SEpSet
epSet
;
syncUtilraftId2EpSet
(
destRaftId
,
&
epSet
);
syncUtilraftId2EpSet
(
destRaftId
,
&
epSet
);
if
(
pSyncNode
->
FpSendMsg
!=
NULL
)
{
if
(
pSyncNode
->
FpSendMsg
!=
NULL
)
{
if
(
gRaftDetailLog
)
{
char
*
JsonStr
=
syncRpcMsg2Str
(
pMsg
);
syncUtilJson2Line
(
JsonStr
);
sTrace
(
"sync send msg, vgId:%d, type:%d, msg:%s"
,
pSyncNode
->
vgId
,
pMsg
->
msgType
,
JsonStr
);
taosMemoryFree
(
JsonStr
);
}
// htonl
// htonl
syncUtilMsgHtoN
(
pMsg
->
pCont
);
syncUtilMsgHtoN
(
pMsg
->
pCont
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录