Merge pull request #18743 from taosdata/fix/TD-20802.2
fix: fix task redirect not finished issue
This commit is contained in:
commit
f56916cff9
|
@ -377,7 +377,7 @@ extern SSchedulerMgmt schMgmt;
|
||||||
#define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode)
|
#define SCH_IS_EXPLAIN_JOB(_job) (EXPLAIN_MODE_ANALYZE == (_job)->attr.explainMode)
|
||||||
#define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL)
|
#define SCH_NETWORK_ERR(_code) ((_code) == TSDB_CODE_RPC_BROKEN_LINK || (_code) == TSDB_CODE_RPC_NETWORK_UNAVAIL)
|
||||||
#define SCH_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \
|
#define SCH_MERGE_TASK_NETWORK_ERR(_task, _code, _len) \
|
||||||
(SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task))))
|
(SCH_NETWORK_ERR(_code) && (((_len) > 0) || (!SCH_IS_DATA_BIND_TASK(_task)) || (_task)->redirectCtx.inRedirect))
|
||||||
#define SCH_REDIRECT_MSGTYPE(_msgType) \
|
#define SCH_REDIRECT_MSGTYPE(_msgType) \
|
||||||
((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \
|
((_msgType) == TDMT_SCH_LINK_BROKEN || (_msgType) == TDMT_SCH_QUERY || (_msgType) == TDMT_SCH_MERGE_QUERY || \
|
||||||
(_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH)
|
(_msgType) == TDMT_SCH_FETCH || (_msgType) == TDMT_SCH_MERGE_FETCH)
|
||||||
|
|
|
@ -156,6 +156,8 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
|
||||||
SCH_RET(schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode));
|
SCH_RET(schHandleRedirect(pJob, pTask, (SDataBuf *)pMsg, rspCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pTask->redirectCtx.inRedirect = false;
|
||||||
|
|
||||||
switch (msgType) {
|
switch (msgType) {
|
||||||
case TDMT_VND_COMMIT_RSP: {
|
case TDMT_VND_COMMIT_RSP: {
|
||||||
SCH_ERR_JRET(rspCode);
|
SCH_ERR_JRET(rspCode);
|
||||||
|
|
|
@ -362,17 +362,12 @@ int32_t schChkUpdateRedirectCtx(SSchJob *pJob, SSchTask *pTask, SEpSet *pEpSet,
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->totalTimes++;
|
pCtx->totalTimes++;
|
||||||
|
pCtx->roundTimes++;
|
||||||
|
|
||||||
if (SCH_IS_DATA_BIND_TASK(pTask) && pEpSet) {
|
if (SCH_IS_DATA_BIND_TASK(pTask) && pEpSet) {
|
||||||
pCtx->roundTotal = pEpSet->numOfEps;
|
pCtx->roundTotal = pEpSet->numOfEps;
|
||||||
pCtx->roundTimes = 0;
|
|
||||||
|
|
||||||
pTask->delayExecMs = 0;
|
|
||||||
|
|
||||||
goto _return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->roundTimes++;
|
|
||||||
|
|
||||||
if (pCtx->roundTimes >= pCtx->roundTotal) {
|
if (pCtx->roundTimes >= pCtx->roundTotal) {
|
||||||
int64_t nowTs = taosGetTimestampMs();
|
int64_t nowTs = taosGetTimestampMs();
|
||||||
|
|
|
@ -85,6 +85,7 @@ print ======== step3
|
||||||
system sh/exec.sh -n dnode2 -s stop
|
system sh/exec.sh -n dnode2 -s stop
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
|
$t = 0
|
||||||
$x = 0
|
$x = 0
|
||||||
loop:
|
loop:
|
||||||
|
|
||||||
|
@ -126,8 +127,8 @@ print ======== step8
|
||||||
$lastRows = $data00
|
$lastRows = $data00
|
||||||
print ======== loop Times $x
|
print ======== loop Times $x
|
||||||
|
|
||||||
if $x < 2 then
|
if $t < 2 then
|
||||||
$x = $x + 1
|
$t = $t + 1
|
||||||
goto loop
|
goto loop
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
@ -138,4 +139,4 @@ system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue