This is an automated email from the ASF dual-hosted git repository. kirs pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 41e554dd7ef [Fix](Insert-Job)Resolving Task Status Discrepancies in Query Execution Records (#45342) 41e554dd7ef is described below commit 41e554dd7efca2762244f2cc27eed936b31e63f8 Author: Calvin Kirs <guoqi...@selectdb.com> AuthorDate: Fri Dec 13 16:57:10 2024 +0800 [Fix](Insert-Job)Resolving Task Status Discrepancies in Query Execution Records (#45342) ### What problem does this PR solve? When querying the execution records of tasks, the current system has two sources that may describe task status: Task status in the scheduling module: Represents the processing status of tasks within the scheduling system. Task status in LoadManager: Specifically refers to the status of Insert-type tasks, containing more detailed execution information. When the data in the LoadManager is deleted or expires, the completion status will revert to the task status from the scheduling system, which could cause confusion. Therefore, consistency needs to be maintained. Since these two sources may have inconsistencies in their status information, they can easily cause confusion for users and developers. --- .../main/java/org/apache/doris/job/extensions/insert/InsertTask.java | 2 +- regression-test/suites/job_p0/test_base_insert_job.groovy | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/InsertTask.java b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/InsertTask.java index 23a367d5d6e..a577250dc86 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/InsertTask.java +++ b/fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/InsertTask.java @@ -244,7 +244,7 @@ public class InsertTask extends AbstractTask { trow.addToColumnValue(new TCell().setStringVal(String.valueOf(getJobId()))); trow.addToColumnValue(new TCell().setStringVal(jobName)); trow.addToColumnValue(new TCell().setStringVal(getJobId() + LABEL_SPLITTER + getTaskId())); - trow.addToColumnValue(new TCell().setStringVal(jobInfo.getState().name())); + trow.addToColumnValue(new TCell().setStringVal(getStatus().name())); trow.addToColumnValue(new TCell().setStringVal(getErrorMsg())); // create time trow.addToColumnValue(new TCell().setStringVal(TimeUtils.longToTimeString(getCreateTimeMs()))); diff --git a/regression-test/suites/job_p0/test_base_insert_job.groovy b/regression-test/suites/job_p0/test_base_insert_job.groovy index 2bdf96cd5bd..33ae28443b2 100644 --- a/regression-test/suites/job_p0/test_base_insert_job.groovy +++ b/regression-test/suites/job_p0/test_base_insert_job.groovy @@ -116,7 +116,7 @@ suite("test_base_insert_job") { def taskStatus = sql """select status from tasks("type"="insert") where JobName ='${jobName}'""" for (int i = 0; i < taskStatus.size(); i++) { - assert taskStatus.get(i).get(0) =="CANCELED" || taskStatus.get(i).get(0) =="FINISHED" + assert taskStatus.get(i).get(0) =="CANCELED" || taskStatus.get(i).get(0) =="SUCCESS" } sql """ CREATE JOB ${jobMixedName} ON SCHEDULE every 1 second DO insert into ${tableName} (timestamp, type, user_id) values ('2023-03-18','1','12213'); @@ -168,7 +168,7 @@ suite("test_base_insert_job") { // table should have one record after job finished assert datas.size() == 1 // one time job only has one task. when job finished, task status should be FINISHED - assert datas.get(0).get(0) == "FINISHED" + assert datas.get(0).get(0) == "SUCCESS" // check table data def dataCount1 = sql """select count(1) from ${tableName} where user_id=1001""" assert dataCount1.get(0).get(0) == 1 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org