Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
93be707c
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看板
提交
93be707c
编写于
1月 11, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
068697bf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
51 deletion
+50
-51
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/libs/executor/src/executorMain.c
source/libs/executor/src/executorMain.c
+3
-3
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+3
-6
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+43
-41
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
93be707c
...
...
@@ -546,7 +546,7 @@ void* doFetchRow(SRequestObj* pRequest) {
if
(
pResultInfo
->
pData
==
NULL
||
pResultInfo
->
current
>=
pResultInfo
->
numOfRows
)
{
if
(
pRequest
->
type
==
TDMT_VND_QUERY
)
{
pRequest
->
type
=
TDMT_VND_FETCH
;
scheduleFetchRows
(
pRequest
->
body
.
pQueryJob
,
&
pRequest
->
body
.
resInfo
.
pData
);
scheduleFetchRows
(
pRequest
->
body
.
pQueryJob
,
(
void
**
)
&
pRequest
->
body
.
resInfo
.
pData
);
}
else
if
(
pRequest
->
type
==
TDMT_MND_SHOW
)
{
pRequest
->
type
=
TDMT_MND_SHOW_RETRIEVE
;
}
else
if
(
pRequest
->
type
==
TDMT_VND_SHOW_TABLES
)
{
...
...
source/libs/executor/src/executorMain.c
浏览文件 @
93be707c
...
...
@@ -191,9 +191,9 @@ int32_t qExecTask(qTaskInfo_t tinfo, DataSinkHandle* handle) {
return
pTaskInfo
->
code
;
}
int32_t
status
=
0
;
bool
qcontinue
=
false
;
SInputData
inputData
=
{.
pData
=
pRes
,
.
pTableRetrieveTsMap
=
NULL
};
pTaskInfo
->
code
=
dsPutDataBlock
(
pTaskInfo
->
dsHandle
,
&
inputData
,
&
status
);
pTaskInfo
->
code
=
dsPutDataBlock
(
pTaskInfo
->
dsHandle
,
&
inputData
,
&
qcontinue
);
if
(
isTaskKilled
(
pTaskInfo
))
{
qDebug
(
"QInfo:0x%"
PRIx64
" task is killed"
,
GET_TASKID
(
pTaskInfo
));
...
...
@@ -202,7 +202,7 @@ int32_t qExecTask(qTaskInfo_t tinfo, DataSinkHandle* handle) {
// pRuntimeEnv->resultInfo.total);
}
if
(
status
==
DS_DATA_FULL
)
{
if
(
!
qcontinue
)
{
qDebug
(
"QInfo:0x%"
PRIx64
" query paused, %d rows returned, total:%"
PRId64
" rows, in sinkNode:%d"
,
GET_TASKID
(
pTaskInfo
),
0
,
0L
,
0
);
return
pTaskInfo
->
code
;
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
93be707c
...
...
@@ -6,6 +6,7 @@
#include "qworkerInt.h"
#include "tmsg.h"
#include "tname.h"
#include "dataSinkMgt.h"
int32_t
qwValidateStatus
(
int8_t
oriStatus
,
int8_t
newStatus
)
{
int32_t
code
=
0
;
...
...
@@ -891,14 +892,10 @@ int32_t qwHandleFetch(SQWorkerTaskHandlesCache *handles, SQWorkerMgmt *mgmt, uin
QW_ERR_JRET
(
TSDB_CODE_QRY_APP_ERROR
);
}
code
=
dsGetDataLength
(
handles
->
sinkHandle
,
&
dataLength
,
&
queryEnd
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
qError
(
"dsGetDataLength failed, code:%x"
,
code
);
QW_ERR_JRET
(
code
);
}
dsGetDataLength
(
handles
->
sinkHandle
,
&
dataLength
,
&
queryEnd
);
if
(
dataLength
>
0
)
{
SOut
P
utData
output
=
{
0
};
SOut
p
utData
output
=
{
0
};
QW_ERR_JRET
(
qwInitFetchRsp
(
dataLength
,
&
rsp
));
output
.
pData
=
rsp
->
data
;
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
93be707c
...
...
@@ -509,6 +509,27 @@ int32_t schTaskCheckAndSetRetry(SSchJob *job, SSchTask *task, int32_t errCode, b
}
// Note: no more error processing, handled in function internal
int32_t
schProcessOnJobFailure
(
SSchJob
*
pJob
,
int32_t
errCode
)
{
// if already FAILED, no more processing
SCH_ERR_RET
(
schCheckAndUpdateJobStatus
(
pJob
,
JOB_TASK_STATUS_FAILED
));
if
(
errCode
)
{
atomic_store_32
(
&
pJob
->
errCode
,
errCode
);
}
if
(
atomic_load_8
(
&
pJob
->
userFetch
)
||
((
!
SCH_JOB_NEED_FETCH
(
&
pJob
->
attr
))
&&
pJob
->
attr
.
syncSchedule
))
{
tsem_post
(
&
pJob
->
rspSem
);
}
SCH_ERR_RET
(
atomic_load_32
(
&
pJob
->
errCode
));
assert
(
0
);
}
// Note: no more error processing, handled in function internal
int32_t
schFetchFromRemote
(
SSchJob
*
pJob
)
{
int32_t
code
=
0
;
...
...
@@ -540,25 +561,6 @@ _return:
}
// Note: no more error processing, handled in function internal
int32_t
schProcessOnJobFailure
(
SSchJob
*
pJob
,
int32_t
errCode
)
{
// if already FAILED, no more processing
SCH_ERR_RET
(
schCheckAndUpdateJobStatus
(
pJob
,
JOB_TASK_STATUS_FAILED
));
if
(
errCode
)
{
atomic_store_32
(
&
pJob
->
errCode
,
errCode
);
}
if
(
atomic_load_8
(
&
pJob
->
userFetch
)
||
((
!
SCH_JOB_NEED_FETCH
(
&
pJob
->
attr
))
&&
pJob
->
attr
.
syncSchedule
))
{
tsem_post
(
&
pJob
->
rspSem
);
}
SCH_ERR_RET
(
atomic_load_32
(
&
pJob
->
errCode
));
assert
(
0
);
}
// Note: no more error processing, handled in function internal
int32_t
schProcessOnJobPartialSuccess
(
SSchJob
*
pJob
)
{
int32_t
code
=
0
;
...
...
@@ -760,8 +762,6 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
break
;
}
break
;
}
case
TDMT_VND_QUERY_RSP
:
{
SQueryTableRsp
*
rsp
=
(
SQueryTableRsp
*
)
msg
;
...
...
@@ -784,8 +784,6 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t msgType, ch
break
;
}
break
;
}
case
TDMT_VND_FETCH_RSP
:
{
SRetrieveTableRsp
*
rsp
=
(
SRetrieveTableRsp
*
)
msg
;
...
...
@@ -1316,7 +1314,7 @@ int32_t scheduleExecJob(void *transport, SArray *nodeList, SQueryDag* pDag, stru
SSchJob
*
job
=
NULL
;
SCH_ERR_RET
(
schExecJobImpl
(
transport
,
nodeList
,
pDag
,
(
void
**
)
&
job
,
true
));
SCH_ERR_RET
(
schExecJobImpl
(
transport
,
nodeList
,
pDag
,
&
job
,
true
));
*
pJob
=
job
;
...
...
@@ -1333,7 +1331,7 @@ int32_t scheduleAsyncExecJob(void *transport, SArray *nodeList, SQueryDag* pDag,
SSchJob
*
job
=
NULL
;
SCH_ERR_RET
(
schExecJobImpl
(
transport
,
nodeList
,
pDag
,
(
void
**
)
&
job
,
false
));
SCH_ERR_RET
(
schExecJobImpl
(
transport
,
nodeList
,
pDag
,
&
job
,
false
));
*
pJob
=
job
;
...
...
@@ -1368,11 +1366,11 @@ int32_t scheduleFetchRows(SSchJob *pJob, void** pData) {
}
if
(
status
==
JOB_TASK_STATUS_FAILED
)
{
*
d
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
*
pD
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
atomic_store_ptr
(
&
pJob
->
res
,
NULL
);
SCH_ERR_JRET
(
atomic_load_32
(
&
pJob
->
errCode
));
}
else
if
(
status
==
JOB_TASK_STATUS_SUCCEED
)
{
*
d
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
*
pD
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
atomic_store_ptr
(
&
pJob
->
res
,
NULL
);
goto
_return
;
}
else
if
(
status
==
JOB_TASK_STATUS_PARTIAL_SUCCEED
)
{
...
...
@@ -1392,9 +1390,9 @@ int32_t scheduleFetchRows(SSchJob *pJob, void** pData) {
}
while
(
true
)
{
*
d
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
*
pD
ata
=
atomic_load_ptr
(
&
pJob
->
res
);
if
(
*
data
!=
atomic_val_compare_exchange_ptr
(
&
pJob
->
res
,
*
d
ata
,
NULL
))
{
if
(
*
pData
!=
atomic_val_compare_exchange_ptr
(
&
pJob
->
res
,
*
pD
ata
,
NULL
))
{
continue
;
}
...
...
@@ -1472,17 +1470,21 @@ void scheduleFreeJob(void *job) {
taosArrayDestroy
(
pLevel
->
subTasks
);
}
taosHashCleanup
(
pJob
->
execTasks
);
taosHashCleanup
(
pJob
->
failTasks
);
taosHashCleanup
(
pJob
->
succTasks
);
taosArrayDestroy
(
pJob
->
levels
);
taosHashCleanup
(
pJob
->
execTasks
);
taosHashCleanup
(
pJob
->
failTasks
);
taosHashCleanup
(
pJob
->
succTasks
);
tfree
(
pJob
->
res
);
tfree
(
pJob
);
}
taosArrayDestroy
(
pJob
->
levels
);
tfree
(
pJob
->
res
);
void
schedulerDestroy
(
void
)
{
if
(
schMgmt
.
jobs
)
{
taosHashCleanup
(
sch
tfree
(
pJob
);
}
void
schedulerDestroy
(
void
)
{
if
(
schMgmt
.
jobs
)
{
taosHashCleanup
(
schMgmt
.
jobs
);
//TODO
schMgmt
.
jobs
=
NULL
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录