fix: task reschedule seriousId issue

This commit is contained in:
dapan1121 2024-12-23 08:49:16 +08:00
parent b1702132b4
commit 8892920ebc
2 changed files with 4 additions and 2 deletions

View File

@ -189,7 +189,6 @@ int32_t schProcessOnTaskFailure(SSchJob *pJob, SSchTask *pTask, int32_t errCode)
} }
pTask->failedExecId = pTask->execId; pTask->failedExecId = pTask->execId;
pTask->failedSeriousId = pTask->seriousId;
int8_t jobStatus = 0; int8_t jobStatus = 0;
if (schJobNeedToStop(pJob, &jobStatus)) { if (schJobNeedToStop(pJob, &jobStatus)) {
@ -1381,6 +1380,7 @@ int32_t schLaunchLevelTasks(SSchJob *pJob, SSchLevel *level) {
for (int32_t i = 0; i < level->taskNum; ++i) { for (int32_t i = 0; i < level->taskNum; ++i) {
SSchTask *pTask = taosArrayGet(level->subTasks, i); SSchTask *pTask = taosArrayGet(level->subTasks, i);
pTask->failedSeriousId = pJob->seriousId - 1;
pTask->seriousId = pJob->seriousId; pTask->seriousId = pJob->seriousId;
SCH_TASK_DLOG("task seriousId set to 0x%" PRIx64, pTask->seriousId); SCH_TASK_DLOG("task seriousId set to 0x%" PRIx64, pTask->seriousId);

View File

@ -1008,6 +1008,9 @@ TEST(queryTest, rescheduleCase) {
load.addr.epSet.eps[0].port = 6031; load.addr.epSet.eps[0].port = 6031;
assert(taosArrayPush(qnodeList, &load) != NULL); assert(taosArrayPush(qnodeList, &load) != NULL);
TAOS_STRCPY(load.addr.epSet.eps[0].fqdn, "qnode1.ep");
assert(taosArrayPush(qnodeList, &load) != NULL);
code = schedulerInit(); code = schedulerInit();
ASSERT_EQ(code, 0); ASSERT_EQ(code, 0);
@ -1079,7 +1082,6 @@ TEST(queryTest, rescheduleCase) {
pIter = taosHashIterate(pJob->execTasks, pIter); pIter = taosHashIterate(pJob->execTasks, pIter);
} }
pIter = taosHashIterate(pJob->execTasks, NULL); pIter = taosHashIterate(pJob->execTasks, NULL);
while (pIter) { while (pIter) {
SSchTask *task = *(SSchTask **)pIter; SSchTask *task = *(SSchTask **)pIter;