Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3cbe109e
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
3cbe109e
编写于
11月 30, 2022
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: initialize vnode state applyTerm with commitTerm in vnodeOpen
上级
decb17fc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
9 deletion
+14
-9
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+2
-2
source/dnode/vnode/src/vnd/vnodeOpen.c
source/dnode/vnode/src/vnd/vnodeOpen.c
+3
-6
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+1
-0
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+7
-0
source/libs/sync/src/syncTimeout.c
source/libs/sync/src/syncTimeout.c
+1
-1
未找到文件。
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
3cbe109e
...
@@ -209,8 +209,8 @@ int vnodeCommit(SVnode *pVnode) {
...
@@ -209,8 +209,8 @@ int vnodeCommit(SVnode *pVnode) {
SVnodeInfo
info
=
{
0
};
SVnodeInfo
info
=
{
0
};
char
dir
[
TSDB_FILENAME_LEN
];
char
dir
[
TSDB_FILENAME_LEN
];
vInfo
(
"vgId:%d, start to commit, commit ID:%"
PRId64
" version:%"
PRId64
,
TD_VID
(
pVnode
),
pVnode
->
state
.
commitID
,
vInfo
(
"vgId:%d, start to commit, commit ID:%"
PRId64
" version:%"
PRId64
" term: %"
PRId64
,
TD_VID
(
pVnode
)
,
pVnode
->
state
.
applied
);
pVnode
->
state
.
commitID
,
pVnode
->
state
.
applied
,
pVnode
->
state
.
applyTerm
);
// persist wal before starting
// persist wal before starting
if
(
walPersist
(
pVnode
->
pWal
)
<
0
)
{
if
(
walPersist
(
pVnode
->
pWal
)
<
0
)
{
...
...
source/dnode/vnode/src/vnd/vnodeOpen.c
浏览文件 @
3cbe109e
...
@@ -144,9 +144,9 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
...
@@ -144,9 +144,9 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
pVnode
->
config
=
info
.
config
;
pVnode
->
config
=
info
.
config
;
pVnode
->
state
.
committed
=
info
.
state
.
committed
;
pVnode
->
state
.
committed
=
info
.
state
.
committed
;
pVnode
->
state
.
commitTerm
=
info
.
state
.
commitTerm
;
pVnode
->
state
.
commitTerm
=
info
.
state
.
commitTerm
;
pVnode
->
state
.
applied
=
info
.
state
.
committed
;
pVnode
->
state
.
commitID
=
info
.
state
.
commitID
;
pVnode
->
state
.
commitID
=
info
.
state
.
commitID
;
pVnode
->
state
.
commitTerm
=
info
.
state
.
commitTerm
;
pVnode
->
state
.
applied
=
info
.
state
.
committed
;
pVnode
->
state
.
applyTerm
=
info
.
state
.
commitTerm
;
pVnode
->
pTfs
=
pTfs
;
pVnode
->
pTfs
=
pTfs
;
pVnode
->
msgCb
=
msgCb
;
pVnode
->
msgCb
=
msgCb
;
taosThreadMutexInit
(
&
pVnode
->
lock
,
NULL
);
taosThreadMutexInit
(
&
pVnode
->
lock
,
NULL
);
...
@@ -269,10 +269,7 @@ void vnodeClose(SVnode *pVnode) {
...
@@ -269,10 +269,7 @@ void vnodeClose(SVnode *pVnode) {
}
}
// start the sync timer after the queue is ready
// start the sync timer after the queue is ready
int32_t
vnodeStart
(
SVnode
*
pVnode
)
{
int32_t
vnodeStart
(
SVnode
*
pVnode
)
{
return
vnodeSyncStart
(
pVnode
);
}
vnodeSyncStart
(
pVnode
);
return
0
;
}
void
vnodeStop
(
SVnode
*
pVnode
)
{}
void
vnodeStop
(
SVnode
*
pVnode
)
{}
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
3cbe109e
...
@@ -187,6 +187,7 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
...
@@ -187,6 +187,7 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t version, SRp
vDebug
(
"vgId:%d, start to process write request %s, index:%"
PRId64
,
TD_VID
(
pVnode
),
TMSG_INFO
(
pMsg
->
msgType
),
vDebug
(
"vgId:%d, start to process write request %s, index:%"
PRId64
,
TD_VID
(
pVnode
),
TMSG_INFO
(
pMsg
->
msgType
),
version
);
version
);
ASSERT
(
pVnode
->
state
.
applyTerm
<=
pMsg
->
info
.
conn
.
applyTerm
);
pVnode
->
state
.
applied
=
version
;
pVnode
->
state
.
applied
=
version
;
pVnode
->
state
.
applyTerm
=
pMsg
->
info
.
conn
.
applyTerm
;
pVnode
->
state
.
applyTerm
=
pMsg
->
info
.
conn
.
applyTerm
;
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
3cbe109e
...
@@ -224,6 +224,9 @@ int32_t syncLogBufferInitWithoutLock(SSyncLogBuffer* pBuf, SSyncNode* pNode) {
...
@@ -224,6 +224,9 @@ int32_t syncLogBufferInitWithoutLock(SSyncLogBuffer* pBuf, SSyncNode* pNode) {
// update startIndex
// update startIndex
pBuf
->
startIndex
=
takeDummy
?
index
:
index
+
1
;
pBuf
->
startIndex
=
takeDummy
?
index
:
index
+
1
;
sInfo
(
"vgId:%d, init sync log buffer. buffer: [%"
PRId64
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
// validate
// validate
syncLogBufferValidate
(
pBuf
);
syncLogBufferValidate
(
pBuf
);
return
0
;
return
0
;
...
@@ -826,6 +829,10 @@ int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* p
...
@@ -826,6 +829,10 @@ int32_t syncLogReplMgrReplicateAttemptedOnce(SSyncLogReplMgr* pMgr, SSyncNode* p
pMgr
->
endIndex
=
index
+
1
;
pMgr
->
endIndex
=
index
+
1
;
if
(
barrier
)
{
if
(
barrier
)
{
sInfo
(
"vgId:%d, replicated sync barrier to dest: %"
PRIx64
". index: %"
PRId64
", term: %"
PRId64
", repl mgr: rs(%d) [%"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
pDestId
->
addr
,
index
,
term
,
pMgr
->
restored
,
pMgr
->
startIndex
,
pMgr
->
matchIndex
,
pMgr
->
endIndex
);
break
;
break
;
}
}
}
}
...
...
source/libs/sync/src/syncTimeout.c
浏览文件 @
3cbe109e
...
@@ -52,7 +52,7 @@ static void syncNodeCleanConfigIndex(SSyncNode* ths) {
...
@@ -52,7 +52,7 @@ static void syncNodeCleanConfigIndex(SSyncNode* ths) {
}
}
static
int32_t
syncNodeTimerRoutine
(
SSyncNode
*
ths
)
{
static
int32_t
syncNodeTimerRoutine
(
SSyncNode
*
ths
)
{
sN
Info
(
ths
,
"timer routines"
);
sN
Debug
(
ths
,
"timer routines"
);
// timer replicate
// timer replicate
syncNodeReplicate
(
ths
);
syncNodeReplicate
(
ths
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录