Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e6e0ac76
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e6e0ac76
编写于
5月 16, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:alwalys in exec if consumer Id mismatch & check result for wal seek ver
上级
62520af2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
10 deletion
+18
-10
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+8
-3
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+0
-4
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+10
-3
未找到文件。
source/dnode/vnode/src/tq/tq.c
浏览文件 @
e6e0ac76
...
@@ -358,16 +358,17 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
...
@@ -358,16 +358,17 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
consumerId
,
vgId
,
req
.
subKey
);
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
consumerId
,
vgId
,
req
.
subKey
);
taosMsleep
(
5
);
taosMsleep
(
5
);
}
}
tqSetHandleExec
(
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
// 2. check re-balance status
// 2. check re-balance status
if
(
pHandle
->
consumerId
!=
consumerId
)
{
if
(
pHandle
->
consumerId
!=
consumerId
)
{
tqDebug
(
"ERROR tmq poll: consumer:0x%"
PRIx64
" vgId:%d, subkey %s, mismatch for saved handle consumer:0x%"
PRIx64
,
tqDebug
(
"ERROR tmq poll: consumer:0x%"
PRIx64
" vgId:%d, subkey %s, mismatch for saved handle consumer:0x%"
PRIx64
,
consumerId
,
TD_VID
(
pTq
->
pVnode
),
req
.
subKey
,
pHandle
->
consumerId
);
consumerId
,
TD_VID
(
pTq
->
pVnode
),
req
.
subKey
,
pHandle
->
consumerId
);
terrno
=
TSDB_CODE_TMQ_CONSUMER_MISMATCH
;
terrno
=
TSDB_CODE_TMQ_CONSUMER_MISMATCH
;
taosWUnLockLatch
(
&
pTq
->
lock
);
return
-
1
;
return
-
1
;
}
}
tqSetHandleExec
(
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
// 3. update the epoch value
// 3. update the epoch value
int32_t
savedEpoch
=
pHandle
->
epoch
;
int32_t
savedEpoch
=
pHandle
->
epoch
;
...
@@ -382,7 +383,11 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
...
@@ -382,7 +383,11 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg) {
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
" (epoch %d), subkey %s, recv poll req vgId:%d, req:%s, reqId:0x%"
PRIx64
,
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
" (epoch %d), subkey %s, recv poll req vgId:%d, req:%s, reqId:0x%"
PRIx64
,
consumerId
,
req
.
epoch
,
pHandle
->
subKey
,
vgId
,
buf
,
req
.
reqId
);
consumerId
,
req
.
epoch
,
pHandle
->
subKey
,
vgId
,
buf
,
req
.
reqId
);
return
tqExtractDataForMq
(
pTq
,
pHandle
,
&
req
,
pMsg
);
int
code
=
tqExtractDataForMq
(
pTq
,
pHandle
,
&
req
,
pMsg
);
taosWLockLatch
(
&
pTq
->
lock
);
tqSetHandleIdle
(
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
return
code
;
}
}
int32_t
tqProcessDeleteSubReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
int32_t
tqProcessDeleteSubReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
e6e0ac76
...
@@ -185,7 +185,6 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
...
@@ -185,7 +185,6 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
// lock
// lock
taosWLockLatch
(
&
pTq
->
lock
);
taosWLockLatch
(
&
pTq
->
lock
);
code
=
tqRegisterPushHandle
(
pTq
,
pHandle
,
pMsg
);
code
=
tqRegisterPushHandle
(
pTq
,
pHandle
,
pMsg
);
tqSetHandleIdle
(
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
taosWUnLockLatch
(
&
pTq
->
lock
);
tDeleteSMqDataRsp
(
&
dataRsp
);
tDeleteSMqDataRsp
(
&
dataRsp
);
return
code
;
return
code
;
...
@@ -206,9 +205,6 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
...
@@ -206,9 +205,6 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
consumerId
,
pHandle
->
subKey
,
vgId
,
dataRsp
.
blockNum
,
buf
,
pRequest
->
reqId
,
code
);
consumerId
,
pHandle
->
subKey
,
vgId
,
dataRsp
.
blockNum
,
buf
,
pRequest
->
reqId
,
code
);
tDeleteSMqDataRsp
(
&
dataRsp
);
tDeleteSMqDataRsp
(
&
dataRsp
);
}
}
taosWLockLatch
(
&
pTq
->
lock
);
tqSetHandleIdle
(
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
return
code
;
return
code
;
}
}
...
...
source/libs/wal/src/walRead.c
浏览文件 @
e6e0ac76
...
@@ -247,7 +247,9 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
...
@@ -247,7 +247,9 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
break
;
break
;
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
walReadSeekVerImpl
(
pRead
,
fetchVer
);
if
(
walReadSeekVerImpl
(
pRead
,
fetchVer
)
<
0
){
return
-
1
;
}
seeked
=
true
;
seeked
=
true
;
continue
;
continue
;
}
else
{
}
else
{
...
@@ -354,7 +356,9 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
...
@@ -354,7 +356,9 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
break
;
break
;
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
walReadSeekVerImpl
(
pRead
,
ver
);
if
(
walReadSeekVerImpl
(
pRead
,
ver
)
<
0
){
return
-
1
;
}
seeked
=
true
;
seeked
=
true
;
continue
;
continue
;
}
else
{
}
else
{
...
@@ -488,7 +492,10 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
...
@@ -488,7 +492,10 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
if
(
contLen
==
sizeof
(
SWalCkHead
))
{
break
;
break
;
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
}
else
if
(
contLen
==
0
&&
!
seeked
)
{
walReadSeekVerImpl
(
pReader
,
ver
);
if
(
walReadSeekVerImpl
(
pReader
,
ver
)
<
0
){
taosThreadMutexUnlock
(
&
pReader
->
mutex
);
return
-
1
;
}
seeked
=
true
;
seeked
=
true
;
continue
;
continue
;
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录