提交 0ad85dc0 编写于 作者: D dapan1121

enh: remove hb and query rsp immediately

上级 b809fd48
...@@ -138,6 +138,7 @@ typedef struct SQWTaskCtx { ...@@ -138,6 +138,7 @@ typedef struct SQWTaskCtx {
int32_t execId; int32_t execId;
int32_t level; int32_t level;
bool queryGotData;
bool queryRsped; bool queryRsped;
bool queryEnd; bool queryEnd;
bool queryContinue; bool queryContinue;
......
...@@ -471,8 +471,10 @@ _return: ...@@ -471,8 +471,10 @@ _return:
if (TSDB_CODE_SUCCESS == code && QW_PHASE_POST_QUERY == phase) { if (TSDB_CODE_SUCCESS == code && QW_PHASE_POST_QUERY == phase) {
qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_PART_SUCC); qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_PART_SUCC);
ctx->queryGotData = true;
} }
#if 0
if (QW_PHASE_POST_QUERY == phase && ctx) { if (QW_PHASE_POST_QUERY == phase && ctx) {
ctx->queryRsped = true; ctx->queryRsped = true;
...@@ -485,6 +487,7 @@ _return: ...@@ -485,6 +487,7 @@ _return:
QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", ctx->ctrlConnInfo.handle, code, tstrerror(code)); QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", ctx->ctrlConnInfo.handle, code, tstrerror(code));
} }
} }
#endif
if (ctx) { if (ctx) {
QW_UPDATE_RSP_CODE(ctx, code); QW_UPDATE_RSP_CODE(ctx, code);
...@@ -531,6 +534,15 @@ int32_t qwPreprocessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) { ...@@ -531,6 +534,15 @@ int32_t qwPreprocessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
_return: _return:
#if 1
qwBuildAndSendQueryRsp(qwMsg->msgType + 1, &qwMsg->connInfo, code, ctx);
if (ctx) {
ctx->queryRsped = true;
ctx->phase = -1;
QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", ctx->ctrlConnInfo.handle, code, tstrerror(code));
}
#endif
if (ctx) { if (ctx) {
QW_UPDATE_RSP_CODE(ctx, code); QW_UPDATE_RSP_CODE(ctx, code);
qwReleaseTaskCtx(mgmt, ctx); qwReleaseTaskCtx(mgmt, ctx);
...@@ -600,10 +612,31 @@ _return: ...@@ -600,10 +612,31 @@ _return:
input.msgType = qwMsg->msgType; input.msgType = qwMsg->msgType;
code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL); code = qwHandlePostPhaseEvents(QW_FPARAMS(), QW_PHASE_POST_QUERY, &input, NULL);
// if (!queryRsped) { if (QW_EVENT_RECEIVED(ctx, QW_EVENT_FETCH)) {
// qwBuildAndSendQueryRsp(&qwMsg->connInfo, code); void *rsp = NULL;
// QW_TASK_DLOG("query msg rsped, handle:%p, code:%x - %s", qwMsg->connInfo.handle, code, tstrerror(code)); int32_t dataLen = 0;
//} SOutputData sOutput = {0};
QW_ERR_JRET(qwGetQueryResFromSink(QW_FPARAMS(), ctx, &dataLen, &rsp, &sOutput));
if (rsp) {
bool qComplete = (DS_BUF_EMPTY == sOutput.bufStatus && sOutput.queryEnd);
qwBuildFetchRsp(rsp, &sOutput, dataLen, qComplete);
if (qComplete) {
atomic_store_8((int8_t *)&ctx->queryEnd, true);
}
qwMsg->connInfo = ctx->dataConnInfo;
QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_FETCH);
qwBuildAndSendFetchRsp(ctx->fetchType, &qwMsg->connInfo, rsp, dataLen, code);
rsp = NULL;
QW_TASK_DLOG("fetch rsp send, handle:%p, code:%x - %s, dataLen:%d", qwMsg->connInfo.handle, code,
tstrerror(code), dataLen);
}
}
QW_RET(TSDB_CODE_SUCCESS); QW_RET(TSDB_CODE_SUCCESS);
} }
...@@ -726,7 +759,9 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) { ...@@ -726,7 +759,9 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
locked = true; locked = true;
// RC WARNING // RC WARNING
if (QW_QUERY_RUNNING(ctx)) { if (-1 == ctx->phase || false == ctx->queryGotData) {
QW_TASK_DLOG_E("task query unfinished");
} else if (QW_QUERY_RUNNING(ctx)) {
atomic_store_8((int8_t *)&ctx->queryContinue, 1); atomic_store_8((int8_t *)&ctx->queryContinue, 1);
} else if (0 == atomic_load_8((int8_t *)&ctx->queryInQueue)) { } else if (0 == atomic_load_8((int8_t *)&ctx->queryInQueue)) {
qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_EXEC); qwUpdateTaskStatus(QW_FPARAMS(), JOB_TASK_STATUS_EXEC);
......
...@@ -867,9 +867,11 @@ int32_t schLaunchTaskImpl(void *param) { ...@@ -867,9 +867,11 @@ int32_t schLaunchTaskImpl(void *param) {
SCH_ERR_JRET(schSetTaskCandidateAddrs(pJob, pTask)); SCH_ERR_JRET(schSetTaskCandidateAddrs(pJob, pTask));
#if 0
if (SCH_IS_QUERY_JOB(pJob)) { if (SCH_IS_QUERY_JOB(pJob)) {
SCH_ERR_JRET(schEnsureHbConnection(pJob, pTask)); SCH_ERR_JRET(schEnsureHbConnection(pJob, pTask));
} }
#endif
SCH_ERR_JRET(schBuildAndSendMsg(pJob, pTask, NULL, plan->msgType)); SCH_ERR_JRET(schBuildAndSendMsg(pJob, pTask, NULL, plan->msgType));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册