Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9628a9f7
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看板
提交
9628a9f7
编写于
7月 24, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:open info log in tmq & ignore wal apply ver when read wal
上级
bb86f5c5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
24 addition
and
23 deletion
+24
-23
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+1
-1
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+8
-8
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+2
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+11
-10
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
9628a9f7
...
@@ -712,7 +712,7 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
...
@@ -712,7 +712,7 @@ static void asyncCommitAllOffsets(tmq_t* tmq, tmq_commit_cb* pCommitFp, void* us
end:
end:
taosMemoryFree
(
pParamSet
);
taosMemoryFree
(
pParamSet
);
if
(
p
ParamSet
->
callbackFn
!=
NULL
)
{
if
(
p
CommitFp
!=
NULL
)
{
pCommitFp
(
tmq
,
code
,
userParam
);
pCommitFp
(
tmq
,
code
,
userParam
);
}
}
return
;
return
;
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
9628a9f7
...
@@ -94,7 +94,7 @@ void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId){
...
@@ -94,7 +94,7 @@ void mndDropConsumerFromSdb(SMnode *pMnode, int64_t consumerId){
bool
mndRebTryStart
()
{
bool
mndRebTryStart
()
{
int32_t
old
=
atomic_val_compare_exchange_32
(
&
mqRebInExecCnt
,
0
,
1
);
int32_t
old
=
atomic_val_compare_exchange_32
(
&
mqRebInExecCnt
,
0
,
1
);
m
Debug
(
"tq timer, rebalance counter old val:%d"
,
old
);
m
Info
(
"tq timer, rebalance counter old val:%d"
,
old
);
return
old
==
0
;
return
old
==
0
;
}
}
...
@@ -116,7 +116,7 @@ void mndRebCntDec() {
...
@@ -116,7 +116,7 @@ void mndRebCntDec() {
int32_t
newVal
=
val
-
1
;
int32_t
newVal
=
val
-
1
;
int32_t
oldVal
=
atomic_val_compare_exchange_32
(
&
mqRebInExecCnt
,
val
,
newVal
);
int32_t
oldVal
=
atomic_val_compare_exchange_32
(
&
mqRebInExecCnt
,
val
,
newVal
);
if
(
oldVal
==
val
)
{
if
(
oldVal
==
val
)
{
m
Debug
(
"rebalance trans end, rebalance counter:%d"
,
newVal
);
m
Info
(
"rebalance trans end, rebalance counter:%d"
,
newVal
);
break
;
break
;
}
}
}
}
...
@@ -281,7 +281,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
...
@@ -281,7 +281,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
// rebalance cannot be parallel
// rebalance cannot be parallel
if
(
!
mndRebTryStart
())
{
if
(
!
mndRebTryStart
())
{
m
Debug
(
"mq rebalance already in progress, do nothing"
);
m
Info
(
"mq rebalance already in progress, do nothing"
);
return
0
;
return
0
;
}
}
...
@@ -312,7 +312,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
...
@@ -312,7 +312,7 @@ static int32_t mndProcessMqTimerMsg(SRpcMsg *pMsg) {
int32_t
hbStatus
=
atomic_add_fetch_32
(
&
pConsumer
->
hbStatus
,
1
);
int32_t
hbStatus
=
atomic_add_fetch_32
(
&
pConsumer
->
hbStatus
,
1
);
int32_t
status
=
atomic_load_32
(
&
pConsumer
->
status
);
int32_t
status
=
atomic_load_32
(
&
pConsumer
->
status
);
m
Debug
(
"check for consumer:0x%"
PRIx64
" status:%d(%s), sub-time:%"
PRId64
", createTime:%"
PRId64
", hbstatus:%d"
,
m
Info
(
"check for consumer:0x%"
PRIx64
" status:%d(%s), sub-time:%"
PRId64
", createTime:%"
PRId64
", hbstatus:%d"
,
pConsumer
->
consumerId
,
status
,
mndConsumerStatusName
(
status
),
pConsumer
->
subscribeTime
,
pConsumer
->
createTime
,
pConsumer
->
consumerId
,
status
,
mndConsumerStatusName
(
status
),
pConsumer
->
subscribeTime
,
pConsumer
->
createTime
,
hbStatus
);
hbStatus
);
...
@@ -416,7 +416,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
...
@@ -416,7 +416,7 @@ static int32_t mndProcessMqHbReq(SRpcMsg *pMsg) {
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
req
.
topics
);
i
++
){
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
req
.
topics
);
i
++
){
TopicOffsetRows
*
data
=
taosArrayGet
(
req
.
topics
,
i
);
TopicOffsetRows
*
data
=
taosArrayGet
(
req
.
topics
,
i
);
m
Debug
(
"heartbeat report offset rows.%s:%s"
,
pConsumer
->
cgroup
,
data
->
topicName
);
m
Info
(
"heartbeat report offset rows.%s:%s"
,
pConsumer
->
cgroup
,
data
->
topicName
);
SMqSubscribeObj
*
pSub
=
mndAcquireSubscribe
(
pMnode
,
pConsumer
->
cgroup
,
data
->
topicName
);
SMqSubscribeObj
*
pSub
=
mndAcquireSubscribe
(
pMnode
,
pConsumer
->
cgroup
,
data
->
topicName
);
if
(
pSub
==
NULL
){
if
(
pSub
==
NULL
){
...
@@ -1104,13 +1104,13 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
...
@@ -1104,13 +1104,13 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
}
}
if
(
taosArrayGetSize
(
pConsumer
->
assignedTopics
)
==
0
)
{
if
(
taosArrayGetSize
(
pConsumer
->
assignedTopics
)
==
0
)
{
m
Debug
(
"showing consumer:0x%"
PRIx64
" no assigned topic, skip"
,
pConsumer
->
consumerId
);
m
Info
(
"showing consumer:0x%"
PRIx64
" no assigned topic, skip"
,
pConsumer
->
consumerId
);
sdbRelease
(
pSdb
,
pConsumer
);
sdbRelease
(
pSdb
,
pConsumer
);
continue
;
continue
;
}
}
taosRLockLatch
(
&
pConsumer
->
lock
);
taosRLockLatch
(
&
pConsumer
->
lock
);
m
Debug
(
"showing consumer:0x%"
PRIx64
,
pConsumer
->
consumerId
);
m
Info
(
"showing consumer:0x%"
PRIx64
,
pConsumer
->
consumerId
);
int32_t
topicSz
=
taosArrayGetSize
(
pConsumer
->
assignedTopics
);
int32_t
topicSz
=
taosArrayGetSize
(
pConsumer
->
assignedTopics
);
bool
hasTopic
=
true
;
bool
hasTopic
=
true
;
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
9628a9f7
...
@@ -1207,7 +1207,7 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
...
@@ -1207,7 +1207,7 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
int32_t
numOfRows
=
0
;
int32_t
numOfRows
=
0
;
SMqSubscribeObj
*
pSub
=
NULL
;
SMqSubscribeObj
*
pSub
=
NULL
;
m
Debug
(
"mnd show subscriptions begin"
);
m
Info
(
"mnd show subscriptions begin"
);
while
(
numOfRows
<
rowsCapacity
)
{
while
(
numOfRows
<
rowsCapacity
)
{
pShow
->
pIter
=
sdbFetch
(
pSdb
,
SDB_SUBSCRIBE
,
pShow
->
pIter
,
(
void
**
)
&
pSub
);
pShow
->
pIter
=
sdbFetch
(
pSdb
,
SDB_SUBSCRIBE
,
pShow
->
pIter
,
(
void
**
)
&
pSub
);
...
@@ -1247,7 +1247,7 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
...
@@ -1247,7 +1247,7 @@ int32_t mndRetrieveSubscribe(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock
sdbRelease
(
pSdb
,
pSub
);
sdbRelease
(
pSdb
,
pSub
);
}
}
m
Debug
(
"mnd end show subscriptions"
);
m
Info
(
"mnd end show subscriptions"
);
pShow
->
numOfRows
+=
numOfRows
;
pShow
->
numOfRows
+=
numOfRows
;
return
numOfRows
;
return
numOfRows
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
9628a9f7
...
@@ -703,7 +703,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
...
@@ -703,7 +703,7 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
SMqVDeleteReq
*
pReq
=
(
SMqVDeleteReq
*
)
msg
;
SMqVDeleteReq
*
pReq
=
(
SMqVDeleteReq
*
)
msg
;
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
tq
Debug
(
"vgId:%d, tq process delete sub req %s"
,
vgId
,
pReq
->
subKey
);
tq
Info
(
"vgId:%d, tq process delete sub req %s"
,
vgId
,
pReq
->
subKey
);
int32_t
code
=
0
;
int32_t
code
=
0
;
taosWLockLatch
(
&
pTq
->
lock
);
taosWLockLatch
(
&
pTq
->
lock
);
...
@@ -784,7 +784,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
...
@@ -784,7 +784,7 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
return
-
1
;
return
-
1
;
}
}
tq
Debug
(
"vgId:%d, tq process sub req:%s, Id:0x%"
PRIx64
" -> Id:0x%"
PRIx64
,
pTq
->
pVnode
->
config
.
vgId
,
req
.
subKey
,
tq
Info
(
"vgId:%d, tq process sub req:%s, Id:0x%"
PRIx64
" -> Id:0x%"
PRIx64
,
pTq
->
pVnode
->
config
.
vgId
,
req
.
subKey
,
req
.
oldConsumerId
,
req
.
newConsumerId
);
req
.
oldConsumerId
,
req
.
newConsumerId
);
STqHandle
*
pHandle
=
NULL
;
STqHandle
*
pHandle
=
NULL
;
...
...
source/libs/wal/src/walRead.c
浏览文件 @
9628a9f7
...
@@ -70,17 +70,18 @@ int32_t walNextValidMsg(SWalReader *pReader) {
...
@@ -70,17 +70,18 @@ int32_t walNextValidMsg(SWalReader *pReader) {
int64_t
fetchVer
=
pReader
->
curVersion
;
int64_t
fetchVer
=
pReader
->
curVersion
;
int64_t
lastVer
=
walGetLastVer
(
pReader
->
pWal
);
int64_t
lastVer
=
walGetLastVer
(
pReader
->
pWal
);
int64_t
committedVer
=
walGetCommittedVer
(
pReader
->
pWal
);
int64_t
committedVer
=
walGetCommittedVer
(
pReader
->
pWal
);
int64_t
appliedVer
=
walGetAppliedVer
(
pReader
->
pWal
);
//
int64_t appliedVer = walGetAppliedVer(pReader->pWal);
if
(
appliedVer
<
committedVer
){
// wait apply ver equal to commit ver, otherwise may lost data when consume data [TD-24010]
//
if(appliedVer < committedVer){ // wait apply ver equal to commit ver, otherwise may lost data when consume data [TD-24010]
wDebug
(
"vgId:%d, wal apply ver:%"
PRId64
" smaller than commit ver:%"
PRId64
,
pReader
->
pWal
->
cfg
.
vgId
,
appliedVer
,
committedVer
);
//
wDebug("vgId:%d, wal apply ver:%"PRId64" smaller than commit ver:%"PRId64, pReader->pWal->cfg.vgId, appliedVer, committedVer);
}
//
}
int64_t
endVer
=
TMIN
(
appliedVer
,
committedVer
);
// int64_t endVer = TMIN(appliedVer, committedVer);
int64_t
endVer
=
committedVer
;
wDebug
(
"vgId:%d, wal start to fetch, index:%"
PRId64
", last index:%"
PRId64
" commit index:%"
PRId64
wDebug
(
"vgId:%d, wal start to fetch, index:%"
PRId64
", last index:%"
PRId64
" commit index:%"
PRId64
",
applied index:%"
PRId64
",
end index:%"
PRId64
,
", end index:%"
PRId64
,
pReader
->
pWal
->
cfg
.
vgId
,
fetchVer
,
lastVer
,
committedVer
,
appliedVer
,
endVer
);
pReader
->
pWal
->
cfg
.
vgId
,
fetchVer
,
lastVer
,
committedVer
,
endVer
);
if
(
fetchVer
>
endVer
){
if
(
fetchVer
>
endVer
){
terrno
=
TSDB_CODE_WAL_LOG_NOT_EXIST
;
terrno
=
TSDB_CODE_WAL_LOG_NOT_EXIST
;
...
@@ -370,9 +371,9 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
...
@@ -370,9 +371,9 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
pRead
->
pWal
->
vers
.
appliedVer
);
pRead
->
pWal
->
vers
.
appliedVer
);
// TODO: valid ver
// TODO: valid ver
if
(
ver
>
pRead
->
pWal
->
vers
.
appliedVer
)
{
//
if (ver > pRead->pWal->vers.appliedVer) {
return
-
1
;
//
return -1;
}
//
}
if
(
pRead
->
curVersion
!=
ver
)
{
if
(
pRead
->
curVersion
!=
ver
)
{
code
=
walReaderSeekVer
(
pRead
,
ver
);
code
=
walReaderSeekVer
(
pRead
,
ver
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录