Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
878401c1
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看板
提交
878401c1
编写于
2月 17, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix query crash on super table
上级
cc5ae34d
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
127 addition
and
109 deletion
+127
-109
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-0
source/client/src/clientHb.c
source/client/src/clientHb.c
+1
-1
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+94
-94
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+2
-0
source/client/src/tmq.c
source/client/src/tmq.c
+3
-3
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+1
-1
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+1
-0
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+13
-2
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+11
-8
未找到文件。
include/libs/qcom/query.h
浏览文件 @
878401c1
...
...
@@ -112,6 +112,7 @@ typedef struct STableMetaOutput {
typedef
struct
SDataBuf
{
void
*
pData
;
uint32_t
len
;
void
*
handle
;
}
SDataBuf
;
typedef
int32_t
(
*
__async_send_cb_fn_t
)(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
...
...
source/client/src/clientHb.c
浏览文件 @
878401c1
...
...
@@ -444,7 +444,7 @@ static void* hbThreadFunc(void* param) {
}
void
*
abuf
=
buf
;
tSerializeSClientHbBatchReq
(
&
abuf
,
pReq
);
SMsgSendInfo
*
pInfo
=
malloc
(
sizeof
(
SMsgSendInfo
));
SMsgSendInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SMsgSendInfo
));
if
(
pInfo
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tFreeClientHbBatchReq
(
pReq
,
false
);
...
...
source/client/src/clientImpl.c
浏览文件 @
878401c1
此差异已折叠。
点击以展开。
source/client/src/clientMsgHandler.c
浏览文件 @
878401c1
...
...
@@ -105,6 +105,7 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj *pRequest) {
pRetrieveMsg
->
showId
=
htobe64
(
pRequest
->
body
.
showInfo
.
execId
);
pMsgSendInfo
->
msgInfo
.
pData
=
pRetrieveMsg
;
pMsgSendInfo
->
msgInfo
.
len
=
sizeof
(
SRetrieveTableReq
);
pMsgSendInfo
->
msgInfo
.
handle
=
NULL
;
}
else
{
SVShowTablesFetchReq
*
pFetchMsg
=
calloc
(
1
,
sizeof
(
SVShowTablesFetchReq
));
if
(
pFetchMsg
==
NULL
)
{
...
...
@@ -116,6 +117,7 @@ SMsgSendInfo* buildMsgInfoImpl(SRequestObj *pRequest) {
pMsgSendInfo
->
msgInfo
.
pData
=
pFetchMsg
;
pMsgSendInfo
->
msgInfo
.
len
=
sizeof
(
SVShowTablesFetchReq
);
pMsgSendInfo
->
msgInfo
.
handle
=
NULL
;
}
}
else
{
assert
(
pRequest
!=
NULL
);
...
...
source/client/src/tmq.c
浏览文件 @
878401c1
...
...
@@ -252,7 +252,7 @@ tmq_resp_err_t tmq_subscribe(tmq_t* tmq, tmq_list_t* topic_list) {
SMqSubscribeCbParam
param
=
{.
rspErr
=
TMQ_RESP_ERR__SUCCESS
,
.
tmq
=
tmq
};
tsem_init
(
&
param
.
rspSem
,
0
,
0
);
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
buf
,
.
len
=
tlen
};
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
buf
,
.
len
=
tlen
,
.
handle
=
NULL
};
SMsgSendInfo
*
sendInfo
=
buildMsgInfoImpl
(
pRequest
);
sendInfo
->
param
=
&
param
;
...
...
@@ -381,7 +381,7 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i
tSerializeSCMCreateTopicReq
(
&
abuf
,
&
req
);
/*printf("formatted: %s\n", dagStr);*/
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
buf
,
.
len
=
tlen
};
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
buf
,
.
len
=
tlen
,
.
handle
=
NULL
};
pRequest
->
type
=
TDMT_MND_CREATE_TOPIC
;
SMsgSendInfo
*
sendInfo
=
buildMsgInfoImpl
(
pRequest
);
...
...
@@ -686,7 +686,7 @@ tmq_message_t* tmq_consumer_poll(tmq_t* tmq, int64_t blocking_time) {
tsem_init
(
&
param
->
rspSem
,
0
,
0
);
SRequestObj
*
pRequest
=
createRequest
(
tmq
->
pTscObj
,
NULL
,
NULL
,
TDMT_VND_CONSUME
);
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
pReq
,
.
len
=
sizeof
(
SMqConsumeReq
)};
pRequest
->
body
.
requestMsg
=
(
SDataBuf
){.
pData
=
pReq
,
.
len
=
sizeof
(
SMqConsumeReq
)
,
.
handle
=
NULL
};
SMsgSendInfo
*
sendInfo
=
buildMsgInfoImpl
(
pRequest
);
sendInfo
->
requestObjRefId
=
0
;
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
878401c1
...
...
@@ -137,7 +137,7 @@ int32_t asyncSendMsgToServer(void *pTransporter, SEpSet* epSet, int64_t* pTransp
.
pCont
=
pMsg
,
.
contLen
=
pInfo
->
msgInfo
.
len
,
.
ahandle
=
(
void
*
)
pInfo
,
.
handle
=
NULL
,
.
handle
=
pInfo
->
msgInfo
.
handle
,
.
code
=
0
};
...
...
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
878401c1
...
...
@@ -95,6 +95,7 @@ typedef struct SSchTask {
int32_t
childReady
;
// child task ready number
SArray
*
children
;
// the datasource tasks,from which to fetch the result, element is SQueryTask*
SArray
*
parents
;
// the data destination tasks, get data from current task, element is SQueryTask*
void
*
handle
;
// task send handle
}
SSchTask
;
typedef
struct
SSchJobAttr
{
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
878401c1
...
...
@@ -18,6 +18,10 @@
#include "query.h"
#include "catalog.h"
typedef
struct
SSchTrans
{
void
*
transInst
;
void
*
transHandle
;
}
SSchTrans
;
static
SSchedulerMgmt
schMgmt
=
{
0
};
uint64_t
schGenTaskId
(
void
)
{
...
...
@@ -932,6 +936,7 @@ int32_t schHandleCallback(void* param, const SDataBuf* pMsg, int32_t msgType, in
pTask
=
*
task
;
SCH_TASK_DLOG
(
"rsp msg received, type:%s, code:%s"
,
TMSG_INFO
(
msgType
),
tstrerror
(
rspCode
));
pTask
->
handle
=
pMsg
->
handle
;
SCH_ERR_JRET
(
schHandleResponseMsg
(
pJob
,
pTask
,
msgType
,
pMsg
->
pData
,
pMsg
->
len
,
rspCode
));
_return:
...
...
@@ -1000,6 +1005,9 @@ int32_t schGetCallbackFp(int32_t msgType, __async_send_cb_fn_t *fp) {
int32_t
schAsyncSendMsg
(
void
*
transport
,
SEpSet
*
epSet
,
uint64_t
qId
,
uint64_t
tId
,
int32_t
msgType
,
void
*
msg
,
uint32_t
msgSize
)
{
int32_t
code
=
0
;
SSchTrans
*
trans
=
(
SSchTrans
*
)
transport
;
SMsgSendInfo
*
pMsgSendInfo
=
calloc
(
1
,
sizeof
(
SMsgSendInfo
));
if
(
NULL
==
pMsgSendInfo
)
{
qError
(
"QID:%"
PRIx64
",TID:%"
PRIx64
" calloc %d failed"
,
qId
,
tId
,
(
int32_t
)
sizeof
(
SMsgSendInfo
));
...
...
@@ -1018,14 +1026,16 @@ int32_t schAsyncSendMsg(void *transport, SEpSet* epSet, uint64_t qId, uint64_t t
param
->
queryId
=
qId
;
param
->
taskId
=
tId
;
pMsgSendInfo
->
param
=
param
;
pMsgSendInfo
->
msgInfo
.
pData
=
msg
;
pMsgSendInfo
->
msgInfo
.
len
=
msgSize
;
pMsgSendInfo
->
msgInfo
.
handle
=
trans
->
transHandle
;
pMsgSendInfo
->
msgType
=
msgType
;
pMsgSendInfo
->
fp
=
fp
;
int64_t
transporterId
=
0
;
code
=
asyncSendMsgToServer
(
trans
por
t
,
epSet
,
&
transporterId
,
pMsgSendInfo
);
code
=
asyncSendMsgToServer
(
trans
->
transIns
t
,
epSet
,
&
transporterId
,
pMsgSendInfo
);
if
(
code
)
{
SCH_ERR_JRET
(
code
);
}
...
...
@@ -1149,7 +1159,8 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
atomic_store_32
(
&
pTask
->
lastMsgType
,
msgType
);
SCH_ERR_JRET
(
schAsyncSendMsg
(
pJob
->
transport
,
&
epSet
,
pJob
->
queryId
,
pTask
->
taskId
,
msgType
,
msg
,
msgSize
));
SSchTrans
trans
=
{.
transInst
=
pJob
->
transport
,
.
transHandle
=
pTask
->
handle
};
SCH_ERR_JRET
(
schAsyncSendMsg
(
&
trans
,
&
epSet
,
pJob
->
queryId
,
pTask
->
taskId
,
msgType
,
msg
,
msgSize
));
if
(
isCandidateAddr
)
{
SCH_ERR_RET
(
schRecordTaskExecNode
(
pJob
,
pTask
,
addr
));
...
...
source/libs/transport/src/transCli.c
浏览文件 @
878401c1
...
...
@@ -133,15 +133,18 @@ static void clientHandleResp(SCliConn* conn) {
rpcMsg
.
msgType
=
pHead
->
msgType
;
rpcMsg
.
ahandle
=
pCtx
->
ahandle
;
if
(
rpcMsg
.
msgType
==
TDMT_VND_QUERY_RSP
||
rpcMsg
.
msgType
==
TDMT_VND_FETCH_RSP
)
{
if
(
rpcMsg
.
msgType
==
TDMT_VND_QUERY_RSP
||
rpcMsg
.
msgType
==
TDMT_VND_FETCH_RSP
||
rpcMsg
.
msgType
==
TDMT_VND_RES_READY
)
{
rpcMsg
.
handle
=
conn
;
conn
->
persist
=
1
;
tDebug
(
"client conn %p persist by app"
,
conn
);
}
tDebug
(
"client conn %p %s received from %s:%d, local info: %s:%d"
,
conn
,
TMSG_INFO
(
pHead
->
msgType
),
inet_ntoa
(
conn
->
addr
.
sin_addr
),
ntohs
(
conn
->
addr
.
sin_port
),
inet_ntoa
(
conn
->
locaddr
.
sin_addr
),
ntohs
(
conn
->
locaddr
.
sin_port
));
conn
->
secured
=
pHead
->
secured
;
if
(
conn
->
push
!=
NULL
&&
conn
->
ctnRdCnt
!=
0
)
{
(
*
conn
->
push
->
callback
)(
conn
->
push
->
arg
,
&
rpcMsg
);
conn
->
push
=
NULL
;
...
...
@@ -156,7 +159,6 @@ static void clientHandleResp(SCliConn* conn) {
}
}
conn
->
ctnRdCnt
+=
1
;
conn
->
secured
=
pHead
->
secured
;
// buf's mem alread translated to rpcMsg.pCont
transClearBuffer
(
&
conn
->
readBuf
);
...
...
@@ -166,16 +168,14 @@ static void clientHandleResp(SCliConn* conn) {
SCliThrdObj
*
pThrd
=
conn
->
hostThrd
;
// user owns conn->persist = 1
if
(
conn
->
push
==
NULL
||
conn
->
persist
==
0
)
{
if
(
conn
->
push
==
NULL
&&
conn
->
persist
==
0
)
{
addConnToPool
(
pThrd
->
pool
,
pCtx
->
ip
,
pCtx
->
port
,
conn
);
destroyCmsg
(
conn
->
data
);
conn
->
data
=
NULL
;
}
destroyCmsg
(
conn
->
data
);
conn
->
data
=
NULL
;
// start thread's timer of conn pool if not active
if
(
!
uv_is_active
((
uv_handle_t
*
)
pThrd
->
timer
)
&&
pRpc
->
idleTime
>
0
)
{
uv_timer_start
((
uv_timer_t
*
)
pThrd
->
timer
,
clientTimeoutCb
,
CONN_PERSIST_TIME
(
pRpc
->
idleTime
)
/
2
,
0
);
//
uv_timer_start((uv_timer_t*)pThrd->timer, clientTimeoutCb, CONN_PERSIST_TIME(pRpc->idleTime) / 2, 0);
}
}
static
void
clientHandleExcept
(
SCliConn
*
pConn
)
{
...
...
@@ -330,6 +330,9 @@ static void clientAllocBufferCb(uv_handle_t* handle, size_t suggested_size, uv_b
}
static
void
clientReadCb
(
uv_stream_t
*
handle
,
ssize_t
nread
,
const
uv_buf_t
*
buf
)
{
// impl later
if
(
handle
->
data
==
NULL
)
{
return
;
}
SCliConn
*
conn
=
handle
->
data
;
SConnBuffer
*
pBuf
=
&
conn
->
readBuf
;
if
(
nread
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录