Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1ea88207
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看板
未验证
提交
1ea88207
编写于
8月 03, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
8月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15697 from taosdata/fix/dnode
fix: adjust logs
上级
415ff2b1
f7e83414
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
13 addition
and
9 deletion
+13
-9
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+9
-8
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+1
-1
source/libs/sync/src/syncTimeout.c
source/libs/sync/src/syncTimeout.c
+3
-0
未找到文件。
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
1ea88207
...
...
@@ -19,9 +19,8 @@
#define BATCH_DISABLE 1
static
inline
bool
vnodeIsMsgBlock
(
tmsg_t
type
)
{
return
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_ALTER_TABLE
)
||
(
type
==
TDMT_VND_DROP_TABLE
)
||
(
type
==
TDMT_VND_UPDATE_TAG_VAL
)
||
(
type
==
TDMT_VND_ALTER_REPLICA
);
return
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_ALTER_TABLE
)
||
(
type
==
TDMT_VND_DROP_TABLE
)
||
(
type
==
TDMT_VND_UPDATE_TAG_VAL
)
||
(
type
==
TDMT_VND_ALTER_REPLICA
);
}
static
inline
bool
vnodeIsMsgWeak
(
tmsg_t
type
)
{
return
false
;
}
...
...
@@ -611,10 +610,10 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void
do
{
int32_t
itemSize
=
tmsgGetQueueSize
(
&
pVnode
->
msgCb
,
pVnode
->
config
.
vgId
,
APPLY_QUEUE
);
if
(
itemSize
==
0
)
{
v
Debug
(
"vgId:%d, apply queue is empty, start write snapshot
"
,
pVnode
->
config
.
vgId
);
v
Info
(
"vgId:%d, start write vnode snapshot since apply queue is empty
"
,
pVnode
->
config
.
vgId
);
break
;
}
else
{
v
Debug
(
"vgId:%d, %d items in apply queue, write snapshot later
"
,
pVnode
->
config
.
vgId
);
v
Info
(
"vgId:%d, write vnode snapshot later since %d items in apply queue
"
,
pVnode
->
config
.
vgId
);
taosMsleep
(
10
);
}
}
while
(
true
);
...
...
@@ -630,10 +629,11 @@ static int32_t vnodeSnapshotStartWrite(struct SSyncFSM *pFsm, void *pParam, void
static
int32_t
vnodeSnapshotStopWrite
(
struct
SSyncFSM
*
pFsm
,
void
*
pWriter
,
bool
isApply
,
SSnapshot
*
pSnapshot
)
{
#ifdef USE_TSDB_SNAPSHOT
SVnode
*
pVnode
=
pFsm
->
data
;
vDebug
(
"vgId:%d, stop write snapshot, isApply:%d"
,
pVnode
->
config
.
vgId
,
isApply
);
vInfo
(
"vgId:%d, stop write vnode snapshot, apply:%d, index:%"
PRId64
" term:%"
PRIu64
" config:%"
PRId64
,
pVnode
->
config
.
vgId
,
isApply
,
pSnapshot
->
lastApplyIndex
,
pSnapshot
->
lastApplyTerm
,
pSnapshot
->
lastApplyIndex
);
int32_t
code
=
vnodeSnapWriterClose
(
pWriter
,
!
isApply
,
pSnapshot
);
v
Debug
(
"vgId:%d, apply snapshot to vnode
, code:0x%x"
,
pVnode
->
config
.
vgId
,
code
);
v
Info
(
"vgId:%d, apply vnode snapshot finished
, code:0x%x"
,
pVnode
->
config
.
vgId
,
code
);
return
code
;
#else
taosMemoryFree
(
pWriter
);
...
...
@@ -644,8 +644,9 @@ static int32_t vnodeSnapshotStopWrite(struct SSyncFSM *pFsm, void *pWriter, bool
static
int32_t
vnodeSnapshotDoWrite
(
struct
SSyncFSM
*
pFsm
,
void
*
pWriter
,
void
*
pBuf
,
int32_t
len
)
{
#ifdef USE_TSDB_SNAPSHOT
SVnode
*
pVnode
=
pFsm
->
data
;
vDebug
(
"vgId:%d, continue write vnode snapshot, len:%d"
,
pVnode
->
config
.
vgId
,
len
);
int32_t
code
=
vnodeSnapWrite
(
pWriter
,
pBuf
,
len
);
v
Trace
(
"vgId:%d, write snapshot
, len:%d"
,
pVnode
->
config
.
vgId
,
len
);
v
Debug
(
"vgId:%d, continue write vnode snapshot finished
, len:%d"
,
pVnode
->
config
.
vgId
,
len
);
return
code
;
#else
return
0
;
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
1ea88207
...
...
@@ -484,7 +484,7 @@ SyncIndex syncNodeGetSnapshotConfigIndex(SSyncNode* pSyncNode, SyncIndex snapsho
lastIndex
=
(
pSyncNode
->
pRaftCfg
->
configIndexArr
)[
i
];
}
}
sTrace
(
"vgId:%d, sync get
snapshot
last config index, index:%"
PRId64
" lcindex:%"
PRId64
,
pSyncNode
->
vgId
,
sTrace
(
"vgId:%d, sync get last config index, index:%"
PRId64
" lcindex:%"
PRId64
,
pSyncNode
->
vgId
,
snapshotLastApplyIndex
,
lastIndex
);
return
lastIndex
;
...
...
source/libs/sync/src/syncTimeout.c
浏览文件 @
1ea88207
...
...
@@ -41,18 +41,21 @@ int32_t syncNodeOnTimeoutCb(SSyncNode* ths, SyncTimeout* pMsg) {
// syncNodePingAll(ths);
// syncNodePingPeers(ths);
sTrace
(
"vgId:%d, sync timeout, type:ping count:%d"
,
ths
->
vgId
,
ths
->
pingTimerCounter
);
syncNodeTimerRoutine
(
ths
);
}
}
else
if
(
pMsg
->
timeoutType
==
SYNC_TIMEOUT_ELECTION
)
{
if
(
atomic_load_64
(
&
ths
->
electTimerLogicClockUser
)
<=
pMsg
->
logicClock
)
{
++
(
ths
->
electTimerCounter
);
sInfo
(
"vgId:%d, sync timeout, type:election count:%d"
,
ths
->
vgId
,
ths
->
electTimerCounter
);
syncNodeElect
(
ths
);
}
}
else
if
(
pMsg
->
timeoutType
==
SYNC_TIMEOUT_HEARTBEAT
)
{
if
(
atomic_load_64
(
&
ths
->
heartbeatTimerLogicClockUser
)
<=
pMsg
->
logicClock
)
{
++
(
ths
->
heartbeatTimerCounter
);
sInfo
(
"vgId:%d, sync timeout, type:replicate count:%d"
,
ths
->
vgId
,
ths
->
heartbeatTimerCounter
);
syncNodeReplicate
(
ths
);
}
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录