Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
db5b5c82
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
db5b5c82
编写于
4月 27, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:add log for msg push
上级
8677b56a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
22 deletion
+25
-22
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+3
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+18
-16
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+3
-2
utils/test/c/tmqSim.c
utils/test/c/tmqSim.c
+1
-1
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
db5b5c82
...
...
@@ -1377,7 +1377,7 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
tstrncpy
(
pTopic
->
topicName
,
pTopicEp
->
topic
,
TSDB_TOPIC_FNAME_LEN
);
tstrncpy
(
pTopic
->
db
,
pTopicEp
->
db
,
TSDB_DB_FNAME_LEN
);
tscDebug
(
"consumer:0x%"
PRIx64
", update topic:%s, numOfVgs:%d"
,
tmq
->
consumerId
,
pTopic
->
topicName
,
vgNumGet
);
tscDebug
(
"consumer:0x%"
PRIx64
", update topic:%s, n
ew n
umOfVgs:%d"
,
tmq
->
consumerId
,
pTopic
->
topicName
,
vgNumGet
);
pTopic
->
vgs
=
taosArrayInit
(
vgNumGet
,
sizeof
(
SMqClientVg
));
for
(
int32_t
j
=
0
;
j
<
vgNumGet
;
j
++
)
{
...
...
@@ -1447,14 +1447,14 @@ static bool doUpdateLocalEp(tmq_t* tmq, int32_t epoch, const SMqAskEpRsp* pRsp)
SMqClientTopic
*
pTopicCur
=
taosArrayGet
(
tmq
->
clientTopics
,
i
);
if
(
pTopicCur
->
vgs
)
{
int32_t
vgNumCur
=
taosArrayGetSize
(
pTopicCur
->
vgs
);
tscDebug
(
"consumer:0x%"
PRIx64
",
new
vg num: %d"
,
tmq
->
consumerId
,
vgNumCur
);
tscDebug
(
"consumer:0x%"
PRIx64
",
current
vg num: %d"
,
tmq
->
consumerId
,
vgNumCur
);
for
(
int32_t
j
=
0
;
j
<
vgNumCur
;
j
++
)
{
SMqClientVg
*
pVgCur
=
taosArrayGet
(
pTopicCur
->
vgs
,
j
);
makeTopicVgroupKey
(
vgKey
,
pTopicCur
->
topicName
,
pVgCur
->
vgId
);
char
buf
[
80
];
tFormatOffset
(
buf
,
80
,
&
pVgCur
->
currentOffset
);
tscDebug
(
"consumer:0x%"
PRIx64
",
epoch:%d vgId:%d vgKey:%s, offset:%s"
,
tmq
->
consumerId
,
epoch
,
pVgCur
->
vgId
,
tscDebug
(
"consumer:0x%"
PRIx64
",
doUpdateLocalEp current vg, epoch:%d vgId:%d vgKey:%s, offset:%s"
,
tmq
->
consumerId
,
tmq
->
epoch
,
pVgCur
->
vgId
,
vgKey
,
buf
);
SVgroupSaveInfo
info
=
{.
offset
=
pVgCur
->
currentOffset
,
.
numOfRows
=
pVgCur
->
numOfRows
};
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
db5b5c82
...
...
@@ -553,8 +553,8 @@ int32_t tqProcessSubscribeReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
// remove if it has been register in the push manager, and return one empty block to consumer
// tqUnregisterPushHandle(pTq, req.subKey, (int32_t)strlen(req.subKey), pHandle->consumerId, true);
taosHashRemove
(
pTq
->
pPushMgr
,
&
pHandle
->
consumerId
,
sizeof
(
int64_t
));
int32_t
ret
=
taosHashRemove
(
pTq
->
pPushMgr
,
&
pHandle
->
consumerId
,
sizeof
(
int64_t
));
tqError
(
"vgId:%d remove pHandle:%p,ret:%d consumer Id:0x%"
PRIx64
,
vgId
,
pHandle
,
ret
,
pHandle
->
consumerId
);
if
(
pHandle
->
msg
!=
NULL
)
{
rpcFreeCont
(
pHandle
->
msg
->
pCont
);
taosMemoryFree
(
pHandle
->
msg
);
...
...
@@ -1069,22 +1069,24 @@ int32_t tqProcessSubmitReqForSubscribe(STQ* pTq) {
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
taosWLockLatch
(
&
pTq
->
lock
);
void
*
pIter
=
taosHashIterate
(
pTq
->
pPushMgr
,
NULL
);
while
(
pIter
){
STqHandle
*
pHandle
=
*
(
STqHandle
**
)
pIter
;
tqDebug
(
"vgId:%d start set submit for pHandle:%p"
,
vgId
,
pHandle
);
if
(
ASSERT
(
pHandle
->
msg
!=
NULL
)){
tqError
(
"pHandle->msg should not be null"
);
break
;
}
else
{
SRpcMsg
msg
=
{.
msgType
=
TDMT_VND_TMQ_CONSUME
,
.
pCont
=
pHandle
->
msg
->
pCont
,
.
contLen
=
pHandle
->
msg
->
contLen
,
.
info
=
pHandle
->
msg
->
info
};
tmsgPutToQueue
(
&
pTq
->
pVnode
->
msgCb
,
QUERY_QUEUE
,
&
msg
);
taosMemoryFree
(
pHandle
->
msg
);
pHandle
->
msg
=
NULL
;
if
(
taosHashGetSize
(
pTq
->
pPushMgr
)
>
0
){
void
*
pIter
=
taosHashIterate
(
pTq
->
pPushMgr
,
NULL
);
while
(
pIter
){
STqHandle
*
pHandle
=
*
(
STqHandle
**
)
pIter
;
tqDebug
(
"vgId:%d start set submit for pHandle:%p, consume id:0x%"
PRIx64
,
vgId
,
pHandle
,
pHandle
->
consumerId
);
if
(
ASSERT
(
pHandle
->
msg
!=
NULL
)){
tqError
(
"pHandle->msg should not be null"
);
break
;
}
else
{
SRpcMsg
msg
=
{.
msgType
=
TDMT_VND_TMQ_CONSUME
,
.
pCont
=
pHandle
->
msg
->
pCont
,
.
contLen
=
pHandle
->
msg
->
contLen
,
.
info
=
pHandle
->
msg
->
info
};
tmsgPutToQueue
(
&
pTq
->
pVnode
->
msgCb
,
QUERY_QUEUE
,
&
msg
);
taosMemoryFree
(
pHandle
->
msg
);
pHandle
->
msg
=
NULL
;
}
pIter
=
taosHashIterate
(
pTq
->
pPushMgr
,
pIter
);
}
pIter
=
taosHashIterate
(
pTq
->
pPushMgr
,
pIte
r
);
taosHashClear
(
pTq
->
pPushMg
r
);
}
taosHashClear
(
pTq
->
pPushMgr
);
// unlock
taosWUnLockLatch
(
&
pTq
->
lock
);
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
db5b5c82
...
...
@@ -190,8 +190,9 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
pHandle
->
msg
->
pCont
=
rpcMallocCont
(
pMsg
->
contLen
);
memcpy
(
pHandle
->
msg
->
pCont
,
pMsg
->
pCont
,
pMsg
->
contLen
);
pHandle
->
msg
->
contLen
=
pMsg
->
contLen
;
tqDebug
(
"data is over, register to handle:%p, pCont:%p, len:%d"
,
pHandle
,
pHandle
->
msg
->
pCont
,
pHandle
->
msg
->
contLen
);
taosHashPut
(
pTq
->
pPushMgr
,
&
pHandle
->
consumerId
,
sizeof
(
int64_t
),
&
pHandle
,
POINTER_BYTES
);
int32_t
ret
=
taosHashPut
(
pTq
->
pPushMgr
,
&
pHandle
->
consumerId
,
sizeof
(
int64_t
),
&
pHandle
,
POINTER_BYTES
);
tqDebug
(
"vgId:%d data is over, ret:%d, consumerId:0x%"
PRIx64
", register to pHandle:%p, pCont:%p, len:%d"
,
vgId
,
ret
,
pHandle
->
consumerId
,
pHandle
,
pHandle
->
msg
->
pCont
,
pHandle
->
msg
->
contLen
);
taosWUnLockLatch
(
&
pTq
->
lock
);
tDeleteSMqDataRsp
(
&
dataRsp
);
return
code
;
...
...
utils/test/c/tmqSim.c
浏览文件 @
db5b5c82
...
...
@@ -232,7 +232,7 @@ void saveConfigToLogFile() {
taosFprintfFile
(
g_fp
,
"%s:%s, "
,
g_stConfInfo
.
stThreads
[
i
].
key
[
k
],
g_stConfInfo
.
stThreads
[
i
].
value
[
k
]);
}
taosFprintfFile
(
g_fp
,
"
\n
"
);
taosFprintfFile
(
g_fp
,
" expect rows: %"
PRI
x
64
"
\n
"
,
g_stConfInfo
.
stThreads
[
i
].
expectMsgCnt
);
taosFprintfFile
(
g_fp
,
" expect rows: %"
PRI
d
64
"
\n
"
,
g_stConfInfo
.
stThreads
[
i
].
expectMsgCnt
);
}
char
tmpString
[
128
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录