This is an automated email from the ASF dual-hosted git repository.

jlfsdtc pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/kylin5 by this push:
     new aeef1338b0 KYLIN-6011 unify job_lock fetch sequence when consuming job 
and producing job
aeef1338b0 is described below

commit aeef1338b004e213ae92fa10fea1f181694afe19
Author: Zhong.Zhu <[email protected]>
AuthorDate: Sat Oct 12 18:32:43 2024 +0800

    KYLIN-6011 unify job_lock fetch sequence when consuming job and producing 
job
---
 .../main/java/org/apache/kylin/job/execution/ExecutableManager.java   | 2 --
 src/core-job/src/main/resources/mybatis-mapper/JobLockMapper.xml      | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/src/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java
 
b/src/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java
index 5834c22d11..f73c81cc25 100644
--- 
a/src/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java
+++ 
b/src/core-job/src/main/java/org/apache/kylin/job/execution/ExecutableManager.java
@@ -24,7 +24,6 @@ import static 
org.apache.kylin.common.exception.code.ErrorCodeServer.JOB_STATE_T
 import static 
org.apache.kylin.common.exception.code.ErrorCodeServer.JOB_UPDATE_STATUS_FAILED;
 import static org.apache.kylin.job.constant.ExecutableConstants.YARN_APP_IDS;
 import static 
org.apache.kylin.job.constant.ExecutableConstants.YARN_APP_IDS_DELIMITER;
-import static org.apache.kylin.job.dao.ExecutablePO.HIGHEST_PRIORITY;
 import static org.apache.kylin.job.execution.AbstractExecutable.RUNTIME_INFO;
 
 import java.io.BufferedReader;
@@ -219,7 +218,6 @@ public class ExecutableManager {
 
         AbstractExecutable cronJob = 
JobFactory.createJobWithDefaultParams(factory, jobType);
         if (cronJob != null) {
-            cronJob.setPriority(HIGHEST_PRIORITY);
             EnhancedUnitOfWork.doInTransactionWithCheckAndRetry(() -> {
                 
ExecutableManager.getInstance(KylinConfig.getInstanceFromEnv(), 
project).addJob(cronJob);
                 return null;
diff --git a/src/core-job/src/main/resources/mybatis-mapper/JobLockMapper.xml 
b/src/core-job/src/main/resources/mybatis-mapper/JobLockMapper.xml
index eb176f9f6b..dd32e1894c 100644
--- a/src/core-job/src/main/resources/mybatis-mapper/JobLockMapper.xml
+++ b/src/core-job/src/main/resources/mybatis-mapper/JobLockMapper.xml
@@ -173,7 +173,7 @@
       </if>
       (lock_node IS NULL OR lock_expire_time <![CDATA[<]]> CURRENT_TIMESTAMP) 
AND job_type = 'OFFLINE'
     </where>
-    ORDER BY priority ASC
+      ORDER BY priority ASC,create_time ASC
     <if test="batchSize&gt;=0">
       LIMIT #{batchSize,jdbcType=INTEGER}
     </if>
@@ -190,7 +190,7 @@
     SELECT lock_id
     FROM ${jobLockTable}
     WHERE job_type = 'OFFLINE' and (lock_expire_time <![CDATA[<]]> 
CURRENT_TIMESTAMP OR lock_node IS NULL)
-    ORDER BY create_time
+      ORDER BY priority ASC,create_time ASC
     <if test="batchSize&gt;=0">
       LIMIT #{batchSize,jdbcType=INTEGER}
     </if>

Reply via email to