Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3e26cbbb
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3e26cbbb
编写于
8月 06, 2022
作者:
L
Li Minghao
提交者:
GitHub
8月 06, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15800 from taosdata/feature/3.0_mhli
refactor(sync): make leader life longer
上级
f2d9346b
e628b707
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
4 deletion
+13
-4
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+2
-2
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+4
-1
source/libs/sync/src/syncRequestVote.c
source/libs/sync/src/syncRequestVote.c
+6
-0
source/libs/sync/test/sh/a.sh
source/libs/sync/test/sh/a.sh
+1
-1
未找到文件。
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
3e26cbbb
...
...
@@ -708,8 +708,8 @@ int32_t vnodeSyncOpen(SVnode *pVnode, char *path) {
}
setPingTimerMS
(
pVnode
->
sync
,
5000
);
setElectTimerMS
(
pVnode
->
sync
,
28
00
);
setHeartbeatTimerMS
(
pVnode
->
sync
,
9
00
);
setElectTimerMS
(
pVnode
->
sync
,
40
00
);
setHeartbeatTimerMS
(
pVnode
->
sync
,
7
00
);
return
0
;
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
3e26cbbb
...
...
@@ -1270,6 +1270,8 @@ int32_t syncNodeStopElectTimer(SSyncNode* pSyncNode) {
atomic_add_fetch_64
(
&
pSyncNode
->
electTimerLogicClockUser
,
1
);
taosTmrStop
(
pSyncNode
->
pElectTimer
);
pSyncNode
->
pElectTimer
=
NULL
;
sTrace
(
"vgId:%d, sync %s stop elect timer"
,
pSyncNode
->
vgId
,
syncUtilState2String
(
pSyncNode
->
state
));
return
ret
;
}
...
...
@@ -1343,7 +1345,8 @@ int32_t syncNodeStopHeartbeatTimer(SSyncNode* pSyncNode) {
atomic_add_fetch_64
(
&
pSyncNode
->
heartbeatTimerLogicClockUser
,
1
);
taosTmrStop
(
pSyncNode
->
pHeartbeatTimer
);
pSyncNode
->
pHeartbeatTimer
=
NULL
;
sTrace
(
"vgId:%d, stop heartbeat timer"
,
pSyncNode
->
vgId
);
sTrace
(
"vgId:%d, sync %s stop heartbeat timer"
,
pSyncNode
->
vgId
,
syncUtilState2String
(
pSyncNode
->
state
));
return
ret
;
}
...
...
source/libs/sync/src/syncRequestVote.c
浏览文件 @
3e26cbbb
...
...
@@ -57,11 +57,14 @@ int32_t syncNodeOnRequestVoteCb(SSyncNode* ths, SyncRequestVote* pMsg) {
// maybe update term
if
(
pMsg
->
term
>
ths
->
pRaftStore
->
currentTerm
)
{
syncNodeUpdateTerm
(
ths
,
pMsg
->
term
);
#if 0
if (logOK) {
syncNodeUpdateTerm(ths, pMsg->term);
} else {
syncNodeUpdateTermWithoutStepDown(ths, pMsg->term);
}
#endif
}
ASSERT
(
pMsg
->
term
<=
ths
->
pRaftStore
->
currentTerm
);
...
...
@@ -167,11 +170,14 @@ int32_t syncNodeOnRequestVoteSnapshotCb(SSyncNode* ths, SyncRequestVote* pMsg) {
// maybe update term
if
(
pMsg
->
term
>
ths
->
pRaftStore
->
currentTerm
)
{
syncNodeUpdateTerm
(
ths
,
pMsg
->
term
);
#if 0
if (logOK) {
syncNodeUpdateTerm(ths, pMsg->term);
} else {
syncNodeUpdateTermWithoutStepDown(ths, pMsg->term);
}
#endif
}
ASSERT
(
pMsg
->
term
<=
ths
->
pRaftStore
->
currentTerm
);
...
...
source/libs/sync/test/sh/a.sh
浏览文件 @
3e26cbbb
...
...
@@ -89,7 +89,7 @@ for file in `ls ${logpath}/log.dnode*.vgId*.commit`;do
line
=
`
cat
${
file
}
|
tail
-n1
`
echo
$line
|
awk
'{print $5, $0}'
>>
${
tmpfile
}
done
cat
${
tmpfile
}
|
sort
-k1
>
${
logpath
}
/log.commits
cat
${
tmpfile
}
|
sort
-k1
|
awk
'BEGIN{vgid=$1}{if($1==vgid){print $0}else{print ""; print $0; vgid=$1;}}END{}'
>
${
logpath
}
/log.commits
exit
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录