Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
22d64b9c
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
22d64b9c
编写于
11月 24, 2022
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: remove syncNodeReplicateOne from syncNodeOnSnapshotReply
上级
2e640e8e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
15 deletion
+20
-15
source/dnode/vnode/src/vnd/vnodeBufPool.c
source/dnode/vnode/src/vnd/vnodeBufPool.c
+3
-0
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+14
-13
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+1
-0
source/libs/sync/src/syncSnapshot.c
source/libs/sync/src/syncSnapshot.c
+2
-2
未找到文件。
source/dnode/vnode/src/vnd/vnodeBufPool.c
浏览文件 @
22d64b9c
...
...
@@ -176,6 +176,9 @@ void vnodeBufPoolRef(SVBufPool *pPool) {
}
void
vnodeBufPoolUnRef
(
SVBufPool
*
pPool
)
{
if
(
pPool
==
NULL
)
{
return
;
}
int32_t
nRef
=
atomic_sub_fetch_32
(
&
pPool
->
nRef
,
1
);
if
(
nRef
==
0
)
{
SVnode
*
pVnode
=
pPool
->
pVnode
;
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
22d64b9c
...
...
@@ -497,8 +497,8 @@ int32_t syncLogBufferCommit(SSyncLogBuffer* pBuf, SSyncNode* pNode, int64_t comm
// execute it
if
(
!
syncUtilUserCommit
(
pEntry
->
originalRpcType
))
{
sInfo
(
"vgId:%d,
non-user msg in raft log entry. index: %"
PRId64
", term:%"
PRId64
"
"
,
vgId
,
pEntry
->
index
,
pEntry
->
term
);
sInfo
(
"vgId:%d,
raft mgmt msg in log entry. index: %"
PRId64
", term:%"
PRId64
", type: %s
"
,
vgId
,
pEntry
->
index
,
pEntry
->
term
,
TMSG_INFO
(
pEntry
->
originalRpcType
)
);
pBuf
->
commitIndex
=
index
;
if
(
!
inBuf
)
{
syncEntryDestroy
(
pEntry
);
...
...
@@ -539,7 +539,7 @@ _out:
if
(
!
pNode
->
restoreFinish
&&
pBuf
->
commitIndex
>=
pNode
->
commitIndex
)
{
pNode
->
pFsm
->
FpRestoreFinishCb
(
pNode
->
pFsm
);
pNode
->
restoreFinish
=
true
;
sInfo
(
"vgId:%d, restore finished.
pBuf
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
sInfo
(
"vgId:%d, restore finished.
log buffer
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
}
...
...
@@ -625,8 +625,8 @@ int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNod
ASSERT
(
pMgr
->
matchIndex
==
0
);
if
(
pMsg
->
matchIndex
<
0
)
{
pMgr
->
restored
=
true
;
sInfo
(
"vgId:%d, sync log repl mgr
of peer %s:%d (%"
PRIx64
") restored. pMgr(rs:%d): [%"
PRId64
" %"
PRId64
",
%"
PRId64
"
), pBuf
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
sInfo
(
"vgId:%d, sync log repl mgr
restored. peer: %s:%d (%"
PRIx64
"), repl mgr(rs:%d): [%"
PRId64
"
%"
PRId64
"
, %"
PRId64
"), log buffer
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
host
,
port
,
destId
.
addr
,
pMgr
->
restored
,
pMgr
->
startIndex
,
pMgr
->
matchIndex
,
pMgr
->
endIndex
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
return
0
;
...
...
@@ -641,8 +641,8 @@ int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNod
if
(
pMsg
->
matchIndex
==
pMsg
->
lastSendIndex
)
{
pMgr
->
restored
=
true
;
sInfo
(
"vgId:%d, sync log repl mgr
of peer %s:%d (%"
PRIx64
") restored. pMgr(rs:%d): [%"
PRId64
" %"
PRId64
",
%"
PRId64
"
), pBuf
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
sInfo
(
"vgId:%d, sync log repl mgr
restored. peer: %s:%d (%"
PRIx64
"), repl mgr(rs:%d): [%"
PRId64
"
%"
PRId64
"
, %"
PRId64
"), log buffer
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
host
,
port
,
destId
.
addr
,
pMgr
->
restored
,
pMgr
->
startIndex
,
pMgr
->
matchIndex
,
pMgr
->
endIndex
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
return
0
;
...
...
@@ -663,7 +663,9 @@ int32_t syncLogReplMgrProcessReplyInRecoveryMode(SSyncLogReplMgr* pMgr, SSyncNod
ASSERT
(
term
>=
0
||
terrno
==
TSDB_CODE_WAL_LOG_NOT_EXIST
);
if
(
syncNodeStartSnapshot
(
pNode
,
&
destId
)
<
0
)
{
sError
(
"vgId:%d, failed to start snapshot for peer %s:%d"
,
pNode
->
vgId
,
host
,
port
);
return
-
1
;
}
sInfo
(
"vgId:%d, snapshot replication to peer %s:%d started"
,
pNode
->
vgId
,
host
,
port
);
return
0
;
}
...
...
@@ -702,8 +704,8 @@ int32_t syncLogReplMgrProcessHeartbeatReply(SSyncLogReplMgr* pMgr, SSyncNode* pN
SSyncLogBuffer
*
pBuf
=
pNode
->
pLogBuf
;
taosThreadMutexLock
(
&
pBuf
->
mutex
);
if
(
pMsg
->
startTime
!=
0
&&
pMsg
->
startTime
!=
pMgr
->
peerStartTime
)
{
sInfo
(
"vgId:%d, reset sync log repl mgr in heartbeat.
start time:%"
PRId64
", old start time
:%"
PRId64
""
,
pNode
->
vgId
,
pMsg
->
startTime
,
pMgr
->
peerStartTime
);
sInfo
(
"vgId:%d, reset sync log repl mgr in heartbeat.
peer: %"
PRIx64
", start time:%"
PRId64
", old
:%"
PRId64
""
,
pNode
->
vgId
,
pMsg
->
s
rcId
.
addr
,
pMsg
->
s
tartTime
,
pMgr
->
peerStartTime
);
syncLogReplMgrReset
(
pMgr
);
pMgr
->
peerStartTime
=
pMsg
->
startTime
;
}
...
...
@@ -715,9 +717,8 @@ int32_t syncLogReplMgrProcessReply(SSyncLogReplMgr* pMgr, SSyncNode* pNode, Sync
SSyncLogBuffer
*
pBuf
=
pNode
->
pLogBuf
;
taosThreadMutexLock
(
&
pBuf
->
mutex
);
if
(
pMsg
->
startTime
!=
pMgr
->
peerStartTime
)
{
sInfo
(
"vgId:%d, reset sync log repl mgr in append entries reply. start time:%"
PRId64
", old start time:%"
PRId64
""
,
pNode
->
vgId
,
pMsg
->
startTime
,
pMgr
->
peerStartTime
);
sInfo
(
"vgId:%d, reset sync log repl mgr in append entries reply. peer: %"
PRIx64
", start time:%"
PRId64
", old:%"
PRId64
,
pNode
->
vgId
,
pMsg
->
srcId
.
addr
,
pMsg
->
startTime
,
pMgr
->
peerStartTime
);
syncLogReplMgrReset
(
pMgr
);
pMgr
->
peerStartTime
=
pMsg
->
startTime
;
}
...
...
@@ -923,7 +924,7 @@ int32_t syncLogBufferReset(SSyncLogBuffer* pBuf, SSyncNode* pNode) {
(
void
)
syncLogBufferRollback
(
pBuf
,
pBuf
->
matchIndex
+
1
);
sInfo
(
"vgId:%d, reset log buffer.
pBuf
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
sInfo
(
"vgId:%d, reset log buffer.
log buffer
: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
pBuf
->
endIndex
=
pBuf
->
matchIndex
+
1
;
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
22d64b9c
...
...
@@ -49,6 +49,7 @@
int32_t
syncNodeMaybeSendAppendEntries
(
SSyncNode
*
pSyncNode
,
const
SRaftId
*
destRaftId
,
SRpcMsg
*
pRpcMsg
);
int32_t
syncNodeReplicateOne
(
SSyncNode
*
pSyncNode
,
SRaftId
*
pDestId
,
bool
snapshot
)
{
ASSERT
(
false
&&
"deplicated"
);
// next index
SyncIndex
nextIndex
=
syncIndexMgrGetIndex
(
pSyncNode
->
pNextIndex
,
pDestId
);
...
...
source/libs/sync/src/syncSnapshot.c
浏览文件 @
22d64b9c
...
...
@@ -881,8 +881,8 @@ int32_t syncNodeOnSnapshotReply(SSyncNode *pSyncNode, const SRpcMsg *pRpcMsg) {
snapshotSenderStop
(
pSender
,
true
);
// update next-index
syncIndexMgrSetIndex
(
pSyncNode
->
pNextIndex
,
&
(
pMsg
->
srcId
),
pMsg
->
lastIndex
+
1
);
syncNodeReplicateOne
(
pSyncNode
,
&
(
pMsg
->
srcId
),
false
);
//
syncIndexMgrSetIndex(pSyncNode->pNextIndex, &(pMsg->srcId), pMsg->lastIndex + 1);
//
syncNodeReplicateOne(pSyncNode, &(pMsg->srcId), false);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录