Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3d5073e7
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看板
提交
3d5073e7
编写于
5月 20, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix res issue
上级
a353b1a1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
24 deletion
+16
-24
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+1
-7
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+15
-17
未找到文件。
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
3d5073e7
...
...
@@ -39,12 +39,6 @@ enum {
SCH_WRITE
,
};
typedef
enum
{
SCH_RES_TYPE_QUERY
,
SCH_RES_TYPE_FETCH
,
}
SCH_RES_TYPE
;
typedef
struct
SSchTrans
{
void
*
transInst
;
void
*
transHandle
;
...
...
@@ -197,7 +191,7 @@ typedef struct SSchJob {
int32_t
errCode
;
SArray
*
errList
;
// SArray<SQueryErrorInfo>
SRWLatch
resLock
;
SCH_RES_TYPE
resType
;
void
*
queryRes
;
void
*
resData
;
//TODO free it or not
int32_t
resNumOfRows
;
const
char
*
sql
;
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
3d5073e7
...
...
@@ -1058,8 +1058,6 @@ _return:
int32_t
schProcessOnExplainDone
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SRetrieveTableRsp
*
pRsp
)
{
SCH_TASK_DLOG
(
"got explain rsp, rows:%d, complete:%d"
,
htonl
(
pRsp
->
numOfRows
),
pRsp
->
completed
);
pJob
->
resType
=
SCH_RES_TYPE_FETCH
;
atomic_store_32
(
&
pJob
->
resNumOfRows
,
htonl
(
pRsp
->
numOfRows
));
atomic_store_ptr
(
&
pJob
->
resData
,
pRsp
);
...
...
@@ -1072,9 +1070,9 @@ int32_t schProcessOnExplainDone(SSchJob *pJob, SSchTask *pTask, SRetrieveTableRs
int32_t
schSaveJobQueryRes
(
SSchJob
*
pJob
,
SResReadyRsp
*
rsp
)
{
if
(
rsp
->
tbFName
[
0
])
{
if
(
NULL
==
pJob
->
resData
)
{
pJob
->
resData
=
taosArrayInit
(
pJob
->
taskNum
,
sizeof
(
STbVerInfo
));
if
(
NULL
==
pJob
->
resData
)
{
if
(
NULL
==
pJob
->
queryRes
)
{
pJob
->
queryRes
=
taosArrayInit
(
pJob
->
taskNum
,
sizeof
(
STbVerInfo
));
if
(
NULL
==
pJob
->
queryRes
)
{
SCH_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
}
...
...
@@ -1084,7 +1082,7 @@ int32_t schSaveJobQueryRes(SSchJob *pJob, SResReadyRsp *rsp) {
tbInfo
.
sversion
=
rsp
->
sversion
;
tbInfo
.
tversion
=
rsp
->
tversion
;
taosArrayPush
((
SArray
*
)
pJob
->
resData
,
&
tbInfo
);
taosArrayPush
((
SArray
*
)
pJob
->
queryRes
,
&
tbInfo
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1201,10 +1199,9 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
atomic_add_fetch_32
(
&
pJob
->
resNumOfRows
,
rsp
->
affectedRows
);
SCH_TASK_DLOG
(
"submit succeed, affectedRows:%d"
,
rsp
->
affectedRows
);
pJob
->
resType
=
SCH_RES_TYPE_QUERY
;
SCH_LOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
if
(
pJob
->
resData
)
{
SSubmitRsp
*
sum
=
pJob
->
resData
;
if
(
pJob
->
queryRes
)
{
SSubmitRsp
*
sum
=
pJob
->
queryRes
;
sum
->
affectedRows
+=
rsp
->
affectedRows
;
sum
->
nBlocks
+=
rsp
->
nBlocks
;
sum
->
pBlocks
=
taosMemoryRealloc
(
sum
->
pBlocks
,
sum
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
...
...
@@ -1212,7 +1209,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
taosMemoryFree
(
rsp
->
pBlocks
);
taosMemoryFree
(
rsp
);
}
else
{
pJob
->
resData
=
rsp
;
pJob
->
queryRes
=
rsp
;
}
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
}
...
...
@@ -1246,7 +1243,6 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
SCH_ERR_JRET
(
TSDB_CODE_QRY_INVALID_INPUT
);
}
SCH_ERR_JRET
(
rsp
->
code
);
pJob
->
resType
=
SCH_RES_TYPE_QUERY
;
SCH_ERR_JRET
(
schSaveJobQueryRes
(
pJob
,
rsp
));
...
...
@@ -2424,6 +2420,12 @@ void schFreeJobImpl(void *job) {
qExplainFreeCtx
(
pJob
->
explainCtx
);
if
(
SCH_IS_QUERY_JOB
(
pJob
))
{
taosArrayDestroy
((
SArray
*
)
pJob
->
queryRes
);
}
else
{
tFreeSSubmitRsp
((
SSubmitRsp
*
)
pJob
->
queryRes
);
}
taosMemoryFreeClear
(
pJob
->
resData
);
taosMemoryFreeClear
(
pJob
);
...
...
@@ -2486,8 +2488,6 @@ int32_t schExecStaticExplain(void *transport, SArray *pNodeList, SQueryPlan *pDa
SCH_ERR_JRET
(
qExecStaticExplain
(
pDag
,
(
SRetrieveTableRsp
**
)
&
pJob
->
resData
));
pJob
->
resType
=
SCH_RES_TYPE_FETCH
;
int64_t
refId
=
taosAddRef
(
schMgmt
.
jobRef
,
pJob
);
if
(
refId
<
0
)
{
SCH_JOB_ELOG
(
"taosAddRef job failed, error:%s"
,
tstrerror
(
terrno
));
...
...
@@ -2582,10 +2582,8 @@ _return:
pRes
->
code
=
atomic_load_32
(
&
job
->
errCode
);
pRes
->
numOfRows
=
job
->
resNumOfRows
;
if
(
SCH_RES_TYPE_QUERY
==
job
->
resType
)
{
pRes
->
res
=
job
->
resData
;
job
->
resData
=
NULL
;
}
pRes
->
res
=
job
->
queryRes
;
job
->
queryRes
=
NULL
;
schReleaseJob
(
*
pJob
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录