Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
e0d113b1
T
TDengine
项目概览
XKZJ_WCL
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e0d113b1
编写于
12月 16, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2428
上级
6d2d52bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
10 deletion
+4
-10
src/inc/taoserror.h
src/inc/taoserror.h
+1
-0
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+2
-10
src/sync/src/syncMsg.c
src/sync/src/syncMsg.c
+1
-0
未找到文件。
src/inc/taoserror.h
浏览文件 @
e0d113b1
...
...
@@ -272,6 +272,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SYN_MISMATCHED_CLUSTERID, 0, 0x0906, "Mismatched
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_MISMATCHED_SIGNATURE
,
0
,
0x0907
,
"Mismatched signature"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INVALID_CHECKSUM
,
0
,
0x0908
,
"Invalid msg checksum"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INVALID_MSGLEN
,
0
,
0x0909
,
"Invalid msg length"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SYN_INVALID_MSGTYPE
,
0
,
0x090A
,
"Invalid msg type"
)
// wal
TAOS_DEFINE_ERROR
(
TSDB_CODE_WAL_APP_ERROR
,
0
,
0x1000
,
"Unexpected generic error in wal"
)
...
...
src/sync/src/syncMain.c
浏览文件 @
e0d113b1
...
...
@@ -851,25 +851,17 @@ static void syncProcessFwdResponse(SFwdRsp *pFwdRsp, SSyncPeer *pPeer) {
sTrace
(
"%s, forward-rsp is received, code:%x hver:%"
PRIu64
,
pPeer
->
id
,
pFwdRsp
->
code
,
pFwdRsp
->
version
);
SFwdInfo
*
pFirst
=
pSyncFwds
->
fwdInfo
+
pSyncFwds
->
first
;
bool
found
=
false
;
if
(
pFirst
->
version
<=
pFwdRsp
->
version
&&
pSyncFwds
->
fwds
>
0
)
{
// find the forwardInfo from first
for
(
int32_t
i
=
0
;
i
<
pSyncFwds
->
fwds
;
++
i
)
{
pFwdInfo
=
pSyncFwds
->
fwdInfo
+
(
i
+
pSyncFwds
->
first
)
%
tsMaxFwdInfo
;
if
(
pFwdRsp
->
version
==
pFwdInfo
->
version
)
{
found
=
true
;
syncProcessFwdAck
(
pNode
,
pFwdInfo
,
pFwdRsp
->
code
);
syncRemoveConfirmedFwdInfo
(
pNode
);
break
;
return
;
}
}
}
if
(
!
found
)
{
sTrace
(
"%s, forward-rsp not found first:%d fwds:%d, code:%x hver:%"
PRIu64
,
pPeer
->
id
,
pSyncFwds
->
first
,
pSyncFwds
->
fwds
,
pFwdRsp
->
code
,
pFwdRsp
->
version
);
syncProcessFwdAck
(
pNode
,
pFwdInfo
,
pFwdRsp
->
code
);
}
}
static
void
syncProcessForwardFromPeer
(
char
*
cont
,
SSyncPeer
*
pPeer
)
{
...
...
@@ -1192,7 +1184,7 @@ static void syncProcessFwdAck(SSyncNode *pNode, SFwdInfo *pFwdInfo, int32_t code
}
if
(
confirm
&&
pFwdInfo
->
confirmed
==
0
)
{
sTrace
(
"vgId:%d, forward is confirmed, hver:%"
PRIu64
" code:%x"
,
pNode
->
vgId
,
pFwdInfo
->
version
,
pFwdInfo
->
code
);
sTrace
(
"vgId:%d, forward is confirmed, hver:%"
PRIu64
" code:
0x
%x"
,
pNode
->
vgId
,
pFwdInfo
->
version
,
pFwdInfo
->
code
);
(
*
pNode
->
confirmForward
)(
pNode
->
vgId
,
pFwdInfo
->
mhandle
,
pFwdInfo
->
code
);
pFwdInfo
->
confirmed
=
1
;
}
...
...
src/sync/src/syncMsg.c
浏览文件 @
e0d113b1
...
...
@@ -47,6 +47,7 @@ int32_t syncCheckHead(SSyncHead *pHead) {
if
(
pHead
->
signature
!=
SYNC_SIGNATURE
)
return
TSDB_CODE_SYN_MISMATCHED_SIGNATURE
;
if
(
pHead
->
cId
!=
0
)
return
TSDB_CODE_SYN_MISMATCHED_CLUSTERID
;
if
(
pHead
->
len
<=
0
||
pHead
->
len
>
TSDB_MAX_WAL_SIZE
)
return
TSDB_CODE_SYN_INVALID_MSGLEN
;
if
(
pHead
->
type
<=
TAOS_SMSG_START
||
pHead
->
type
>=
TAOS_SMSG_END
)
return
TSDB_CODE_SYN_INVALID_MSGTYPE
;
if
(
!
taosCheckChecksumWhole
((
uint8_t
*
)
pHead
,
sizeof
(
SSyncHead
)))
return
TSDB_CODE_SYN_INVALID_CHECKSUM
;
return
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录