You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2022/12/28 07:03:52 UTC

[dolphinscheduler] branch 3.0.4-prepare updated (e028e640af -> eb704f8185)

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

zhongjiajie pushed a change to branch 3.0.4-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


    from e028e640af [fix][dml] Also query workflow without tenant by given name (#13075)
     new bc957153c6 [Bug] [Server] Once click online schedule time, task will be automatically scheduled (#13092)
     new eb704f8185 [Bug-12868][UI] Data target type is only HDFS (#12902)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/dolphinscheduler/api/enums/Status.java   |  1 +
 .../api/service/impl/SchedulerServiceImpl.java      | 21 +++++++++++++++++++--
 .../api/service/SchedulerServiceTest.java           | 15 +++++++++++++++
 .../components/node/fields/use-sqoop-target-type.ts |  4 ++++
 .../workflow/definition/components/use-form.ts      |  2 +-
 5 files changed, 40 insertions(+), 3 deletions(-)


[dolphinscheduler] 02/02: [Bug-12868][UI] Data target type is only HDFS (#12902)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch 3.0.4-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit eb704f8185408fae95e890fcf3c5072cb66c8dc4
Author: Sakura-2019 <53...@users.noreply.github.com>
AuthorDate: Wed Dec 28 15:01:25 2022 +0800

    [Bug-12868][UI] Data target type is only HDFS (#12902)
    
    Co-authored-by: Jay Chung <zh...@gmail.com>
    (cherry picked from commit 08052af7a17767dd9fcde7fd313e63f92ab0d4e5)
---
 .../projects/task/components/node/fields/use-sqoop-target-type.ts     | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts
index 5949def7ba..74530678d3 100644
--- a/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts
+++ b/dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts
@@ -61,6 +61,10 @@ export function useTargetType(
       case 'MYSQL':
         if (srcQueryType === '1') {
           return [
+            {
+              label: 'HIVE',
+              value: 'HIVE'
+            },
             {
               label: 'HDFS',
               value: 'HDFS'


[dolphinscheduler] 01/02: [Bug] [Server] Once click online schedule time, task will be automatically scheduled (#13092)

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch 3.0.4-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit bc957153c60fe8b169b072007af42aee948e169b
Author: Aaron Wang <wa...@gmail.com>
AuthorDate: Wed Dec 28 14:51:59 2022 +0800

    [Bug] [Server] Once click online schedule time, task will be automatically scheduled (#13092)
    
    * fix bug that trigger mis-fire strategy when setting start time earlier than current time
    
    * update ut
    
    * add warning msg
    
    * add check start time when set schedule online
    
    (cherry picked from commit 7497b26979ec1ba5c473c99d8e51a97c91250f25)
---
 .../apache/dolphinscheduler/api/enums/Status.java   |  1 +
 .../api/service/impl/SchedulerServiceImpl.java      | 21 +++++++++++++++++++--
 .../api/service/SchedulerServiceTest.java           | 15 +++++++++++++++
 .../workflow/definition/components/use-form.ts      |  2 +-
 4 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
index 2730c85120..652625593b 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
@@ -330,6 +330,7 @@ public enum Status {
     COMMAND_STATE_COUNT_ERROR(80001, "task instance state count error", "查询各状态任务实例数错误"),
     NEGTIVE_SIZE_NUMBER_ERROR(80002, "query size number error", "查询size错误"),
     START_TIME_BIGGER_THAN_END_TIME_ERROR(80003, "start time bigger than end time error", "开始时间在结束时间之后错误"),
+    START_TIME_BEFORE_CURRENT_TIME_ERROR(80004, "start time before current time error", "开始时间在当前时间之前错误"),
     QUEUE_COUNT_ERROR(90001, "queue count error", "查询队列数据错误"),
 
     KERBEROS_STARTUP_STATE(100001, "get kerberos startup state error", "获取kerberos启动状态错误"),
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
index bd481bc2c5..103d1cd720 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
@@ -166,13 +166,18 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
         scheduleObj.setProcessDefinitionName(processDefinition.getName());
 
         ScheduleParam scheduleParam = JSONUtils.parseObject(schedule, ScheduleParam.class);
+        if (now.after(scheduleParam.getStartTime())) {
+            logger.warn("The start time must be later than current time.");
+            putMsg(result, Status.START_TIME_BEFORE_CURRENT_TIME_ERROR);
+            return result;
+        }
         if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {
             logger.warn("The start time must not be the same as the end");
             putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME);
             return result;
         }
         if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) {
-            logger.warn("The start time must smaller than end time");
+            logger.warn("The start time must be smaller than end time.");
             putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR);
             return result;
         }
@@ -319,6 +324,13 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
             return result;
         }
         if (scheduleStatus == ReleaseState.ONLINE) {
+            // check schedule start time
+            Date now = new Date();
+            if (now.after(scheduleObj.getStartTime())) {
+                logger.warn("The start time must be later than current time.");
+                putMsg(result, Status.START_TIME_BEFORE_CURRENT_TIME_ERROR);
+                return result;
+            }
             // check process definition release state
             if (processDefinition.getReleaseState() != ReleaseState.ONLINE) {
                 logger.info("not release process definition id: {} , name : {}",
@@ -667,13 +679,18 @@ public class SchedulerServiceImpl extends BaseServiceImpl implements SchedulerSe
                 putMsg(result, Status.PARSE_TO_CRON_EXPRESSION_ERROR);
                 return;
             }
+            if (now.after(scheduleParam.getStartTime())) {
+                logger.warn("The start time must be later than current time.");
+                putMsg(result, Status.START_TIME_BEFORE_CURRENT_TIME_ERROR);
+                return;
+            }
             if (DateUtils.differSec(scheduleParam.getStartTime(), scheduleParam.getEndTime()) == 0) {
                 logger.warn("The start time must not be the same as the end");
                 putMsg(result, Status.SCHEDULE_START_TIME_END_TIME_SAME);
                 return;
             }
             if (scheduleParam.getStartTime().getTime() > scheduleParam.getEndTime().getTime()) {
-                logger.warn("The start time must smaller than end time");
+                logger.warn("The start time must be smaller than end time.");
                 putMsg(result, Status.START_TIME_BIGGER_THAN_END_TIME_ERROR);
                 return;
             }
diff --git a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SchedulerServiceTest.java b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SchedulerServiceTest.java
index 6ac83e795d..1578673f32 100644
--- a/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SchedulerServiceTest.java
+++ b/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/SchedulerServiceTest.java
@@ -83,6 +83,21 @@ public class SchedulerServiceTest {
     @InjectMocks
     private QuartzExecutorImpl quartzExecutors;
 
+    protected static User user;
+    protected Exception exception;
+    private static final String userName = "userName";
+    private static final String projectName = "projectName";
+    private static final long projectCode = 1L;
+    private static final int userId = 1;
+    private static final String processDefinitionName = "processDefinitionName";
+    private static final long processDefinitionCode = 2L;
+    private static final int processDefinitionVersion = 3;
+    private static final int scheduleId = 3;
+    private static final long environmentCode = 4L;
+    private static final String startTime = "2220-01-01 12:13:14";
+    private static final String endTime = "2220-02-01 12:13:14";
+    private static final String crontab = "0 0 * * * ? *";
+
     @Before
     public void setUp() {
 
diff --git a/dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-form.ts b/dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-form.ts
index 186d0d9532..2e3dd46e1e 100644
--- a/dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-form.ts
+++ b/dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-form.ts
@@ -74,7 +74,7 @@ export const useForm = () => {
     timingFormRef: ref(),
     timingForm: {
       startEndTime: [
-        new Date(year, month, day),
+        new Date(year, month, day + 1),
         new Date(year + 100, month, day)
       ],
       crontab: '0 0 * * * ? *',