Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8572f4a3
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
8572f4a3
编写于
4月 24, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opti:change push mgr to consume msg for subscribe
上级
9bd74ec5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
15 deletion
+22
-15
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+2
-2
source/common/src/tglobal.c
source/common/src/tglobal.c
+4
-4
source/common/src/tmsg.c
source/common/src/tmsg.c
+3
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+7
-5
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+6
-1
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
8572f4a3
...
...
@@ -1702,7 +1702,7 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
for
(
int
j
=
0
;
j
<
numOfVg
;
j
++
)
{
SMqClientVg
*
pVg
=
taosArrayGet
(
pTopic
->
vgs
,
j
);
if
(
taosGetTimestampMs
()
-
pVg
->
emptyBlockReceiveTs
<
EMPTY_BLOCK_POLL_IDLE_DURATION
)
{
// less than 100ms
tsc
Trace
(
"consumer:0x%"
PRIx64
" epoch %d, vgId:%d idle for 10ms before start next poll"
,
tmq
->
consumerId
,
tsc
Debug
(
"consumer:0x%"
PRIx64
" epoch %d, vgId:%d idle for 10ms before start next poll"
,
tmq
->
consumerId
,
tmq
->
epoch
,
pVg
->
vgId
);
continue
;
}
...
...
@@ -1710,7 +1710,7 @@ static int32_t tmqPollImpl(tmq_t* tmq, int64_t timeout) {
int32_t
vgStatus
=
atomic_val_compare_exchange_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
,
TMQ_VG_STATUS__WAIT
);
if
(
vgStatus
==
TMQ_VG_STATUS__WAIT
)
{
int32_t
vgSkipCnt
=
atomic_add_fetch_32
(
&
pVg
->
vgSkipCnt
,
1
);
tsc
Trace
(
"consumer:0x%"
PRIx64
" epoch %d wait poll-rsp, skip vgId:%d skip cnt %d"
,
tmq
->
consumerId
,
tmq
->
epoch
,
tsc
Debug
(
"consumer:0x%"
PRIx64
" epoch %d wait poll-rsp, skip vgId:%d skip cnt %d"
,
tmq
->
consumerId
,
tmq
->
epoch
,
pVg
->
vgId
,
vgSkipCnt
);
continue
;
#if 0
...
...
source/common/src/tglobal.c
浏览文件 @
8572f4a3
...
...
@@ -1274,10 +1274,10 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
taosSetAllDebugFlag
(
cfgGetItem
(
pCfg
,
"debugFlag"
)
->
i32
,
false
);
if
(
taosMulModeMkDir
(
tsLogDir
,
0777
)
!=
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
printf
(
"failed to create dir:%s since %s"
,
tsLogDir
,
terrstr
());
cfgCleanup
(
pCfg
);
return
-
1
;
//
terrno = TAOS_SYSTEM_ERROR(errno);
//
printf("failed to create dir:%s since %s", tsLogDir, terrstr());
//
cfgCleanup(pCfg);
//
return -1;
}
if
(
taosInitLog
(
logname
,
logFileNum
)
!=
0
)
{
...
...
source/common/src/tmsg.c
浏览文件 @
8572f4a3
...
...
@@ -5328,9 +5328,9 @@ int32_t tSerializeSMqPollReq(void *buf, int32_t bufLen, SMqPollReq *pReq) {
int32_t
tDeserializeSMqPollReq
(
void
*
buf
,
int32_t
bufLen
,
SMqPollReq
*
pReq
)
{
int32_t
headLen
=
sizeof
(
SMsgHead
);
SMsgHead
*
pHead
=
buf
;
pHead
->
vgId
=
pReq
->
head
.
vgId
;
pHead
->
contLen
=
pReq
->
head
.
contLen
;
//
SMsgHead *pHead = buf;
//
pHead->vgId = pReq->head.vgId;
//
pHead->contLen = pReq->head.contLen;
SDecoder
decoder
=
{
0
};
tDecoderInit
(
&
decoder
,
(
char
*
)
buf
+
headLen
,
bufLen
-
headLen
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
8572f4a3
...
...
@@ -1084,13 +1084,15 @@ int32_t tqProcessSubmitReqForSubscribe(STQ* pTq) {
taosWLockLatch
(
&
pTq
->
lock
);
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
pTq
->
pPushArray
);
i
++
){
STqHandle
*
pHandle
=
(
STqHandle
*
)
taosArrayGetP
(
pTq
->
pPushArray
,
i
);
if
(
pHandle
->
msg
==
NULL
){
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
;
}
SRpcMsg
msg
=
{.
msgType
=
TDMT_VND_TMQ_CONSUME
,
.
pCont
=
pHandle
->
msg
->
pCont
,
.
contLen
=
pHandle
->
msg
->
contLen
};
tmsgPutToQueue
(
&
pTq
->
pVnode
->
msgCb
,
QUERY_QUEUE
,
&
msg
);
taosMemoryFree
(
pHandle
->
msg
);
pHandle
->
msg
=
NULL
;
}
taosArrayClear
(
pTq
->
pPushArray
);
// unlock
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
8572f4a3
...
...
@@ -181,15 +181,20 @@ static int32_t extractDataAndRspForNormalSubscribe(STQ* pTq, STqHandle* pHandle,
// code = tqRegisterPushHandle(pTq, pHandle, pRequest, pMsg, &dataRsp, TMQ_MSG_TYPE__POLL_RSP);
// lock
taosWLockLatch
(
&
pTq
->
lock
);
if
(
pHandle
->
msg
!=
NULL
){
if
(
ASSERT
(
pHandle
->
msg
==
NULL
)
){
tqError
(
"pHandle->msg should be null"
);
taosWUnLockLatch
(
&
pTq
->
lock
);
goto
end
;
}
pHandle
->
msg
=
taosMemoryCalloc
(
1
,
sizeof
(
SRpcMsg
));
memcpy
(
pHandle
->
msg
,
pMsg
,
sizeof
(
SRpcMsg
));
pHandle
->
msg
->
pCont
=
rpcMallocCont
(
pMsg
->
contLen
);
memcpy
(
pHandle
->
msg
->
pCont
,
pMsg
->
pCont
,
pMsg
->
contLen
);
pHandle
->
msg
->
contLen
=
pMsg
->
contLen
;
tqError
(
"data is over, register to handle:%p, pCont:%p, len:%d"
,
pHandle
,
pHandle
->
msg
->
pCont
,
pHandle
->
msg
->
contLen
);
taosArrayPush
(
pTq
->
pPushArray
,
&
pHandle
);
taosWUnLockLatch
(
&
pTq
->
lock
);
tDeleteSMqDataRsp
(
&
dataRsp
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录