Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7e5d97f0
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
7e5d97f0
编写于
1月 05, 2023
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: stop snapshot receiver on sync post close
上级
84ec8a7f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
2 deletion
+36
-2
include/libs/sync/sync.h
include/libs/sync/sync.h
+1
-0
source/dnode/vnode/src/inc/vnd.h
source/dnode/vnode/src/inc/vnd.h
+1
-0
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+5
-2
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+5
-0
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+1
-0
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+23
-0
未找到文件。
include/libs/sync/sync.h
浏览文件 @
7e5d97f0
...
...
@@ -232,6 +232,7 @@ int64_t syncOpen(SSyncInfo* pSyncInfo);
int32_t
syncStart
(
int64_t
rid
);
void
syncStop
(
int64_t
rid
);
void
syncPreStop
(
int64_t
rid
);
void
syncPostStop
(
int64_t
rid
);
int32_t
syncPropose
(
int64_t
rid
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
);
int32_t
syncProcessMsg
(
int64_t
rid
,
SRpcMsg
*
pMsg
);
int32_t
syncReconfig
(
int64_t
rid
,
SSyncCfg
*
pCfg
);
...
...
source/dnode/vnode/src/inc/vnd.h
浏览文件 @
7e5d97f0
...
...
@@ -98,6 +98,7 @@ bool vnodeShouldRollback(SVnode* pVnode);
int32_t
vnodeSyncOpen
(
SVnode
*
pVnode
,
char
*
path
);
int32_t
vnodeSyncStart
(
SVnode
*
pVnode
);
void
vnodeSyncPreClose
(
SVnode
*
pVnode
);
void
vnodeSyncPostClose
(
SVnode
*
pVnode
);
void
vnodeSyncClose
(
SVnode
*
pVnode
);
void
vnodeRedirectRpcMsg
(
SVnode
*
pVnode
,
SRpcMsg
*
pMsg
,
int32_t
code
);
bool
vnodeIsLeader
(
SVnode
*
pVnode
);
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
7e5d97f0
...
...
@@ -245,9 +245,12 @@ _err:
return
NULL
;
}
void
vnodePreClose
(
SVnode
*
pVnode
)
{
vnodeQueryPreClose
(
pVnode
);
}
void
vnodePreClose
(
SVnode
*
pVnode
)
{
vnodeQueryPreClose
(
pVnode
);
vnodeSyncPreClose
(
pVnode
);
}
void
vnodePostClose
(
SVnode
*
pVnode
)
{
vnodeSyncP
re
Close
(
pVnode
);
}
void
vnodePostClose
(
SVnode
*
pVnode
)
{
vnodeSyncP
ost
Close
(
pVnode
);
}
void
vnodeClose
(
SVnode
*
pVnode
)
{
if
(
pVnode
)
{
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
7e5d97f0
...
...
@@ -614,6 +614,11 @@ void vnodeSyncPreClose(SVnode *pVnode) {
taosThreadMutexUnlock
(
&
pVnode
->
lock
);
}
void
vnodeSyncPostClose
(
SVnode
*
pVnode
)
{
vInfo
(
"vgId:%d, post close sync"
,
pVnode
->
config
.
vgId
);
syncPostStop
(
pVnode
->
sync
);
}
void
vnodeSyncClose
(
SVnode
*
pVnode
)
{
vInfo
(
"vgId:%d, close sync"
,
pVnode
->
config
.
vgId
);
syncStop
(
pVnode
->
sync
);
...
...
source/libs/sync/inc/syncInt.h
浏览文件 @
7e5d97f0
...
...
@@ -228,6 +228,7 @@ int32_t syncNodeStart(SSyncNode* pSyncNode);
int32_t
syncNodeStartStandBy
(
SSyncNode
*
pSyncNode
);
void
syncNodeClose
(
SSyncNode
*
pSyncNode
);
void
syncNodePreClose
(
SSyncNode
*
pSyncNode
);
void
syncNodePostClose
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
,
int64_t
*
seq
);
int32_t
syncNodeRestore
(
SSyncNode
*
pSyncNode
);
void
syncHbTimerDataFree
(
SSyncHbTimerData
*
pData
);
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
7e5d97f0
...
...
@@ -124,6 +124,14 @@ void syncPreStop(int64_t rid) {
}
}
void
syncPostStop
(
int64_t
rid
)
{
SSyncNode
*
pSyncNode
=
syncNodeAcquire
(
rid
);
if
(
pSyncNode
!=
NULL
)
{
syncNodePostClose
(
pSyncNode
);
syncNodeRelease
(
pSyncNode
);
}
}
static
bool
syncNodeCheckNewConfig
(
SSyncNode
*
pSyncNode
,
const
SSyncCfg
*
pCfg
)
{
if
(
!
syncNodeInConfig
(
pSyncNode
,
pCfg
))
return
false
;
return
abs
(
pCfg
->
replicaNum
-
pSyncNode
->
replicaNum
)
<=
1
;
...
...
@@ -1236,6 +1244,7 @@ void syncNodePreClose(SSyncNode* pSyncNode) {
}
}
#if 0
if (pSyncNode->pNewNodeReceiver != NULL) {
if (snapshotReceiverIsStart(pSyncNode->pNewNodeReceiver)) {
snapshotReceiverForceStop(pSyncNode->pNewNodeReceiver);
...
...
@@ -1246,6 +1255,7 @@ void syncNodePreClose(SSyncNode* pSyncNode) {
snapshotReceiverDestroy(pSyncNode->pNewNodeReceiver);
pSyncNode->pNewNodeReceiver = NULL;
}
#endif
// stop elect timer
syncNodeStopElectTimer
(
pSyncNode
);
...
...
@@ -1257,6 +1267,19 @@ void syncNodePreClose(SSyncNode* pSyncNode) {
syncRespCleanRsp
(
pSyncNode
->
pSyncRespMgr
);
}
void
syncNodePostClose
(
SSyncNode
*
pSyncNode
)
{
if
(
pSyncNode
->
pNewNodeReceiver
!=
NULL
)
{
if
(
snapshotReceiverIsStart
(
pSyncNode
->
pNewNodeReceiver
))
{
snapshotReceiverForceStop
(
pSyncNode
->
pNewNodeReceiver
);
}
sDebug
(
"vgId:%d, snapshot receiver destroy while preclose sync node, data:%p"
,
pSyncNode
->
vgId
,
pSyncNode
->
pNewNodeReceiver
);
snapshotReceiverDestroy
(
pSyncNode
->
pNewNodeReceiver
);
pSyncNode
->
pNewNodeReceiver
=
NULL
;
}
}
void
syncHbTimerDataFree
(
SSyncHbTimerData
*
pData
)
{
taosMemoryFree
(
pData
);
}
void
syncNodeClose
(
SSyncNode
*
pSyncNode
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录