Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a9bd009b
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看板
提交
a9bd009b
编写于
1月 25, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix tq
上级
f3aa8139
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
481 addition
and
468 deletion
+481
-468
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+461
-456
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+12
-6
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+1
-1
source/libs/planner/src/physicalPlanJson.c
source/libs/planner/src/physicalPlanJson.c
+1
-0
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+4
-3
source/util/test/CMakeLists.txt
source/util/test/CMakeLists.txt
+2
-2
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
a9bd009b
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
a9bd009b
...
...
@@ -43,7 +43,7 @@ static int32_t mndProcessSubscribeInternalRsp(SMnodeMsg *pMsg);
static
int32_t
mndProcessMqTimerMsg
(
SMnodeMsg
*
pMsg
);
static
int
mndBuildMqSetConsumerVgReq
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SMqConsumerObj
*
pConsumer
,
SMqConsumerTopic
*
pConsumerTopic
,
SMqTopicObj
*
pTopic
);
SMqConsumerTopic
*
pConsumerTopic
,
SMqTopicObj
*
pTopic
,
SMqConsumerEp
*
pSub
);
int32_t
mndInitSubscribe
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_SUBSCRIBE
,
...
...
@@ -184,7 +184,7 @@ static int mndInitUnassignedVg(SMnode *pMnode, SMqTopicObj *pTopic, SArray *unas
}
static
int
mndBuildMqSetConsumerVgReq
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SMqConsumerObj
*
pConsumer
,
SMqConsumerTopic
*
pConsumerTopic
,
SMqTopicObj
*
pTopic
)
{
SMqConsumerTopic
*
pConsumerTopic
,
SMqTopicObj
*
pTopic
,
SMqConsumerEp
*
pCEp
)
{
int32_t
sz
=
taosArrayGetSize
(
pConsumerTopic
->
pVgInfo
);
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
int32_t
vgId
=
*
(
int32_t
*
)
taosArrayGet
(
pConsumerTopic
->
pVgInfo
,
i
);
...
...
@@ -199,6 +199,8 @@ static int mndBuildMqSetConsumerVgReq(SMnode *pMnode, STrans *pTrans, SMqConsume
req
.
sql
=
pTopic
->
sql
;
req
.
logicalPlan
=
pTopic
->
logicalPlan
;
req
.
physicalPlan
=
pTopic
->
physicalPlan
;
req
.
qmsg
=
strdup
(
pCEp
->
qmsg
);
req
.
qmsgLen
=
strlen
(
req
.
qmsg
);
int32_t
tlen
=
tEncodeSMqSetCVgReq
(
NULL
,
&
req
);
void
*
buf
=
malloc
(
sizeof
(
SMsgHead
)
+
tlen
);
if
(
buf
==
NULL
)
{
...
...
@@ -501,17 +503,21 @@ static int32_t mndProcessSubscribeReq(SMnodeMsg *pMsg) {
}
taosArrayPush
(
pSub
->
availConsumer
,
&
consumerId
);
SMqConsumerTopic
*
pConsumerTopic
=
tNewConsumerTopic
(
consumerId
,
pTopic
,
pSub
);
taosArrayPush
(
pConsumer
->
topics
,
pConsumerTopic
);
if
(
taosArrayGetSize
(
pConsumerTopic
->
pVgInfo
)
>
0
)
{
ASSERT
(
taosArrayGetSize
(
pConsumerTopic
->
pVgInfo
)
==
1
);
int32_t
vgId
=
*
(
int32_t
*
)
taosArrayGetLast
(
pConsumerTopic
->
pVgInfo
);
// send setmsg to vnode
if
(
mndBuildMqSetConsumerVgReq
(
pMnode
,
pTrans
,
pConsumer
,
pConsumerTopic
,
pTopic
)
<
0
)
{
// TODO
return
-
1
;
SMqConsumerEp
*
pCEp
=
taosArrayGetLast
(
pSub
->
assigned
);
if
(
pCEp
->
vgId
==
vgId
)
{
if
(
mndBuildMqSetConsumerVgReq
(
pMnode
,
pTrans
,
pConsumer
,
pConsumerTopic
,
pTopic
,
pCEp
)
<
0
)
{
// TODO
return
-
1
;
}
}
// send setmsg to vnode
}
SSdbRaw
*
pRaw
=
mndSubActionEncode
(
pSub
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
a9bd009b
...
...
@@ -811,7 +811,7 @@ int32_t tqProcessSetConnReq(STQ* pTq, char* msg, SRpcMsg** ppRsp) {
for
(
int
i
=
0
;
i
<
TQ_BUFFER_SIZE
;
i
++
)
{
pTopic
->
buffer
.
output
[
i
].
status
=
0
;
STqReadHandle
*
pReadHandle
=
tqInitSubmitMsgScanner
(
pTq
->
pMeta
);
pTopic
->
buffer
.
output
[
i
].
task
=
qCreateStreamExecTaskInfo
(
&
req
.
qmsg
,
pReadHandle
);
pTopic
->
buffer
.
output
[
i
].
task
=
qCreateStreamExecTaskInfo
(
req
.
qmsg
,
pReadHandle
);
}
taosArrayPush
(
pConsumer
->
topics
,
pTopic
);
terrno
=
TSDB_CODE_SUCCESS
;
...
...
source/libs/planner/src/physicalPlanJson.c
浏览文件 @
a9bd009b
...
...
@@ -1132,6 +1132,7 @@ int32_t subPlanToString(const SSubplan* subplan, char** str, int32_t* len) {
}
int32_t
stringToSubplan
(
const
char
*
str
,
SSubplan
**
subplan
)
{
printf
(
"aa: %s
\n
"
,
str
);
cJSON
*
json
=
cJSON_Parse
(
str
);
if
(
NULL
==
json
)
{
return
TSDB_CODE_FAILED
;
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
a9bd009b
...
...
@@ -1482,13 +1482,14 @@ int32_t schedulerConvertDagToTaskList(SQueryDag* pDag, SArray **pTasks) {
}
int32_t
msgSize
=
sizeof
(
SSubQueryMsg
)
+
msgLen
;
msg
=
calloc
(
1
,
msgSize
);
if
(
NULL
==
msg
)
{
qError
(
"calloc %d failed"
,
msgSize
);
SCH_ERR_JRET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
SSubQueryMsg
*
pMsg
=
(
SSubQueryMsg
*
)
msg
;
SSubQueryMsg
*
pMsg
=
calloc
(
1
,
msgSize
);
/*SSubQueryMsg *pMsg = (SSubQueryMsg*) msg;*/
memcpy
(
pMsg
->
msg
,
msg
,
msgLen
);
pMsg
->
header
.
vgId
=
tInfo
.
addr
.
nodeId
;
...
...
@@ -1497,7 +1498,7 @@ int32_t schedulerConvertDagToTaskList(SQueryDag* pDag, SArray **pTasks) {
pMsg
->
taskId
=
schGenUUID
();
pMsg
->
taskType
=
TASK_TYPE_PERSISTENT
;
pMsg
->
contentLen
=
msgLen
;
memcpy
(
pMsg
->
msg
,
msg
,
msgLen
);
/*memcpy(pMsg->msg, ((SSubQueryMsg*)msg)->msg, msgLen);*/
tInfo
.
msg
=
pMsg
;
...
...
source/util/test/CMakeLists.txt
浏览文件 @
a9bd009b
...
...
@@ -13,12 +13,12 @@ IF (HEADER_GTEST_INCLUDE_DIR AND (LIB_GTEST_STATIC_DIR OR LIB_GTEST_SHARED_DIR))
LIST
(
REMOVE_ITEM SOURCE_LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/trefTest.c
)
ADD_EXECUTABLE
(
utilTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
utilTest util common os gtest pthread
gcov
)
TARGET_LINK_LIBRARIES
(
utilTest util common os gtest pthread
)
LIST
(
REMOVE_ITEM SOURCE_LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/cacheTest.cpp
)
LIST
(
APPEND SOURCE_LIST
${
CMAKE_CURRENT_SOURCE_DIR
}
/hashTest.cpp
)
ADD_EXECUTABLE
(
hashTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
hashTest util common os gtest pthread
gcov
)
TARGET_LINK_LIBRARIES
(
hashTest util common os gtest pthread
)
LIST
(
APPEND BIN_SRC
${
CMAKE_CURRENT_SOURCE_DIR
}
/trefTest.c
)
ADD_EXECUTABLE
(
trefTest
${
BIN_SRC
}
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录