status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | for (TaskNode taskNode : taskNodeList) {
String preTasks = taskNode.getPreTasks();
List<String> preTasksList = JSONUtils.toList(preTasks, String.class);
if (preTasksList != null) {
for (String depNode : preTasksList) {
taskNodeRelations.add(new TaskNodeRelation(depNode, taskNode.getName()));
}
}
}
ProcessDag processDag = new ProcessDag();
processDag.setEdges(taskNodeRelations);
processDag.setNodes(taskNodeList);
return processDag;
}
/**
* is there have conditions after the parent node
* @param parentNodeName
* @return
*/
public static boolean haveConditionsAfterNode(String parentNodeName,
DAG<String, TaskNode, TaskNodeRelation> dag
){
boolean result = false;
Set<String> subsequentNodes = dag.getSubsequentNodes(parentNodeName);
if(CollectionUtils.isEmpty(subsequentNodes)){
return result;
}
for(String nodeName : subsequentNodes){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/utils/DagHelper.java | TaskNode taskNode = dag.getNode(nodeName);
List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class);
if(preTasksList.contains(parentNodeName) && taskNode.isConditionsTask()){
return true;
}
}
return result;
}
/**
* is there have conditions after the parent node
* @param parentNodeName
* @return
*/
public static boolean haveConditionsAfterNode(String parentNodeName,
List<TaskNode> taskNodes
){
boolean result = false;
if(CollectionUtils.isEmpty(taskNodes)){
return result;
}
for(TaskNode taskNode : taskNodes){
List<String> preTasksList = JSONUtils.toList(taskNode.getPreTasks(), String.class);
if(preTasksList.contains(parentNodeName) && taskNode.isConditionsTask()){
return true;
}
}
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/utils/DagHelperTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/utils/DagHelperTest.java | * limitations under the License.
*/
package org.apache.dolphinscheduler.dao.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.graph.DAG;
import org.apache.dolphinscheduler.common.model.TaskNode;
import org.apache.dolphinscheduler.common.model.TaskNodeRelation;
import org.apache.dolphinscheduler.common.process.ProcessDag;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessData;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* dag helper test
*/
public class DagHelperTest {
/**
* test task node can submit
* @throws JsonProcessingException if error throws JsonProcessingException
*/
@Test
public void testTaskNodeCanSubmit() throws JsonProcessingException { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/utils/DagHelperTest.java | DAG<String, TaskNode, TaskNodeRelation> dag = generateDag();
TaskNode taskNode3 = dag.getNode("3");
Map<String, TaskInstance > completeTaskList = new HashMap<>();
completeTaskList.putIfAbsent("1", new TaskInstance());
Boolean canSubmit = false;
TaskNode node2 = dag.getNode("2");
node2.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN);
TaskNode nodex = dag.getNode("4");
nodex.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN);
canSubmit = DagHelper.taskNodeCanSubmit(taskNode3, dag, completeTaskList);
Assert.assertEquals(canSubmit, true);
completeTaskList.putIfAbsent("2", new TaskInstance());
TaskNode nodey = dag.getNode("4");
nodey.setRunFlag("");
canSubmit = DagHelper.taskNodeCanSubmit(taskNode3, dag, completeTaskList);
Assert.assertEquals(canSubmit, false);
TaskNode node3 = dag.getNode("3");
node3.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN);
TaskNode node5 = dag.getNode("5");
canSubmit = DagHelper.taskNodeCanSubmit(node5, dag, completeTaskList);
Assert.assertEquals(canSubmit, true);
}
/**
* 1->2->3->5
* 4->3
* @return dag |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/utils/DagHelperTest.java | * @throws JsonProcessingException if error throws JsonProcessingException
*/
private DAG<String, TaskNode, TaskNodeRelation> generateDag() throws JsonProcessingException {
List<TaskNode> taskNodeList = new ArrayList<>();
TaskNode node1 = new TaskNode();
node1.setId("1");
node1.setName("1");
taskNodeList.add(node1);
TaskNode node2 = new TaskNode();
node2.setId("2");
node2.setName("2");
List<String> dep2 = new ArrayList<>();
dep2.add("1");
node2.setDepList(dep2);
taskNodeList.add(node2);
TaskNode node4 = new TaskNode();
node4.setId("4");
node4.setName("4");
taskNodeList.add(node4);
TaskNode node3 = new TaskNode();
node3.setId("3");
node3.setName("3");
List<String> dep3 = new ArrayList<>();
dep3.add("2");
dep3.add("4");
node3.setDepList(dep3);
taskNodeList.add(node3);
TaskNode node5 = new TaskNode();
node5.setId("5");
node5.setName("5"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/utils/DagHelperTest.java | List<String> dep5 = new ArrayList<>();
dep5.add("3");
node5.setDepList(dep5);
taskNodeList.add(node5);
List<String> startNodes = new ArrayList<>();
List<String> recoveryNodes = new ArrayList<>();
List<TaskNode> destTaskNodeList = DagHelper.generateFlowNodeListByStartNode(taskNodeList,
startNodes, recoveryNodes, TaskDependType.TASK_POST);
List<TaskNodeRelation> taskNodeRelations =DagHelper.generateRelationListByFlowNodes(destTaskNodeList);
ProcessDag processDag = new ProcessDag();
processDag.setEdges(taskNodeRelations);
processDag.setNodes(destTaskNodeList);
return DagHelper.buildDagGraph(processDag);
}
@Test
public void testBuildDagGraph() {
String shellJson = "{\"globalParams\":[],\"tasks\":[{\"type\":\"SHELL\",\"id\":\"tasks-9527\",\"name\":\"shell-1\"," +
"\"params\":{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"#!/bin/bash\\necho \\\"shell-1\\\"\"}," +
"\"description\":\"\",\"runFlag\":\"NORMAL\",\"dependence\":{},\"maxRetryTimes\":\"0\",\"retryInterval\":\"1\"," +
"\"timeout\":{\"strategy\":\"\",\"interval\":1,\"enable\":false},\"taskInstancePriority\":\"MEDIUM\"," +
"\"workerGroupId\":-1,\"preTasks\":[]}],\"tenantId\":1,\"timeout\":0}";
ProcessData processData = JSONUtils.parseObject(shellJson, ProcessData.class);
assert processData != null;
List<TaskNode> taskNodeList = processData.getTasks();
ProcessDag processDag = DagHelper.getProcessDag(taskNodeList);
DAG<String, TaskNode, TaskNodeRelation> dag = DagHelper.buildDagGraph(processDag);
Assert.assertNotNull(dag);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/ConditionsTaskExecThread.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.master.runner;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.DependResult;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/ConditionsTaskExecThread.java | import org.apache.dolphinscheduler.common.model.DependentItem;
import org.apache.dolphinscheduler.common.model.DependentTaskModel;
import org.apache.dolphinscheduler.common.task.dependent.DependentParameters;
import org.apache.dolphinscheduler.common.utils.DependentUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.LoggerUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class ConditionsTaskExecThread extends MasterBaseTaskExecThread {
/**
* dependent parameters
*/
private DependentParameters dependentParameters;
/**
* complete task map
*/
private Map<String, ExecutionStatus> completeTaskList = new ConcurrentHashMap<>();
/**
* condition result
*/
private DependResult conditionResult;
/**
* constructor of MasterBaseTaskExecThread
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/ConditionsTaskExecThread.java | * @param taskInstance task instance
*/
public ConditionsTaskExecThread(TaskInstance taskInstance) {
super(taskInstance);
}
@Override
public Boolean submitWaitComplete() {
try{
this.taskInstance = submit();
logger = LoggerFactory.getLogger(LoggerUtils.buildTaskId(LoggerUtils.TASK_LOGGER_INFO_PREFIX,
taskInstance.getProcessDefinitionId(),
taskInstance.getProcessInstanceId(),
taskInstance.getId()));
String threadLoggerInfoName = String.format(Constants.TASK_LOG_INFO_FORMAT, processService.formatTaskAppId(this.taskInstance));
Thread.currentThread().setName(threadLoggerInfoName);
initTaskParameters();
logger.info("dependent task start");
waitTaskQuit();
updateTaskState();
}catch (Exception e){
logger.error("conditions task run exception" , e);
}
return true;
}
private void waitTaskQuit() {
List<TaskInstance> taskInstances = processService.findValidTaskListByProcessId(
taskInstance.getProcessInstanceId()
);
for(TaskInstance task : taskInstances){
completeTaskList.putIfAbsent(task.getName(), task.getState()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/ConditionsTaskExecThread.java | }
List<DependResult> modelResultList = new ArrayList<>();
for(DependentTaskModel dependentTaskModel : dependentParameters.getDependTaskList()){
List<DependResult> itemDependResult = new ArrayList<>();
for(DependentItem item : dependentTaskModel.getDependItemList()){
itemDependResult.add(getDependResultForItem(item));
}
DependResult modelResult = DependentUtils.getDependResultForRelation(dependentTaskModel.getRelation(), itemDependResult);
modelResultList.add(modelResult);
}
conditionResult = DependentUtils.getDependResultForRelation(
dependentParameters.getRelation(), modelResultList
);
logger.info("the conditions task depend result : {}", conditionResult);
}
/**
*
*/
private void updateTaskState() {
ExecutionStatus status;
if(this.cancel){
status = ExecutionStatus.KILL;
}else{
status = (conditionResult == DependResult.SUCCESS) ? ExecutionStatus.SUCCESS : ExecutionStatus.FAILURE;
}
taskInstance.setState(status);
taskInstance.setEndTime(new Date());
processService.updateTaskInstance(taskInstance);
}
private void initTaskParameters() { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/ConditionsTaskExecThread.java | this.taskInstance.setLogPath(getTaskLogPath(taskInstance));
this.taskInstance.setHost(OSUtils.getHost() + Constants.COLON + masterConfig.getListenPort());
taskInstance.setState(ExecutionStatus.RUNNING_EXEUTION);
taskInstance.setStartTime(new Date());
this.processService.saveTaskInstance(taskInstance);
this.dependentParameters = JSONUtils.parseObject(this.taskInstance.getDependency(), DependentParameters.class);
}
/**
* depend result for depend item
* @param item
* @return
*/
private DependResult getDependResultForItem(DependentItem item){
DependResult dependResult = DependResult.SUCCESS;
if(!completeTaskList.containsKey(item.getDepTasks())){
logger.info("depend item: {} have not completed yet.", item.getDepTasks());
dependResult = DependResult.FAILED;
return dependResult;
}
ExecutionStatus executionStatus = completeTaskList.get(item.getDepTasks());
if(executionStatus != item.getStatus()){
logger.info("depend item : {} expect status: {}, actual status: {}" ,item.getDepTasks(), item.getStatus(), executionStatus);
dependResult = DependResult.FAILED;
}
logger.info("dependent item complete {} {},{}",
Constants.DEPENDENT_SPLIT, item.getDepTasks(), dependResult);
return dependResult;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | /*
* Licnsd o h Apach Sofwar Foundaion (ASF) undr on or mor
* conribuor licns agrmns. S h NOTICE fil disribud wih
* his work for addiional informaion rgarding copyrigh ownrship.
* Th ASF licnss his fil o You undr h Apach Licns, Vrsion 2.0
* (h "Licns"); you may no us his fil xcp in complianc wih
* h Licns. You may obain a copy of h Licns a
*
* hp://www.apach.org/licnss/LICENSE-2.0
*
* Unlss rquird by applicabl law or agrd o in wriing, sofwar
* disribud undr h Licns is disribud on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ihr xprss or implid.
* S h Licns for h spcific languag govrning prmissions and
* limiaions undr h Licns.
*/
packag org.apach.dolphinschdulr.srvr.masr.runnr;
impor com.alibaba.fasjson.JSON;
impor com.googl.common.collc.Liss;
impor org.apach.commons.io.FilUils;
impor org.apach.dolphinschdulr.common.Consans;
impor org.apach.dolphinschdulr.common.nums.*;
impor org.apach.dolphinschdulr.common.graph.DAG; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | impor org.apach.dolphinschdulr.common.modl.TaskNod;
impor org.apach.dolphinschdulr.common.modl.TaskNodRlaion;
impor org.apach.dolphinschdulr.common.procss.ProcssDag;
impor org.apach.dolphinschdulr.common.ask.condiions.CondiionsParamrs;
impor org.apach.dolphinschdulr.common.hrad.Soppr;
impor org.apach.dolphinschdulr.common.hrad.ThradUils;
impor org.apach.dolphinschdulr.common.uils.*;
impor org.apach.dolphinschdulr.dao.niy.ProcssInsanc;
impor org.apach.dolphinschdulr.dao.niy.Schdul;
impor org.apach.dolphinschdulr.dao.niy.TaskInsanc;
impor org.apach.dolphinschdulr.dao.uils.DagHlpr;
impor org.apach.dolphinschdulr.rmo.NyRmoingClin;
impor org.apach.dolphinschdulr.srvr.masr.config.MasrConfig;
impor org.apach.dolphinschdulr.srvr.uils.AlrManagr;
impor org.apach.dolphinschdulr.srvic.ban.SpringApplicaionConx;
impor org.apach.dolphinschdulr.srvic.procss.ProcssSrvic;
impor org.apach.dolphinschdulr.srvic.quarz.cron.CronUils;
impor org.slf4j.Loggr;
impor org.slf4j.LoggrFacory;
impor java.io.Fil;
impor java.io.IOExcpion;
impor java.uil.*;
impor java.uil.concurrn.ConcurrnHashMap;
impor java.uil.concurrn.ExcuorSrvic;
impor java.uil.concurrn.Fuur;
impor saic org.apach.dolphinschdulr.common.Consans.*;
/**
* masr xc hrad,spli dag
*/
public class MasrExcThrad implmns Runnabl { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | /**
* loggr of MasrExcThrad
*/
priva saic final Loggr loggr = LoggrFacory.gLoggr(MasrExcThrad.class);
/**
* procss insanc
*/
priva ProcssInsanc procssInsanc;
/**
* runing TaskNod
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva final Map<MasrBasTaskExcThrad,Fuur<Boolan>> acivTaskNod = nw ConcurrnHashMap<>();
/**
* ask xc srvic
*/
priva final ExcuorSrvic askExcSrvic;
/**
* submi failur nods
*/
priva boolan askFaildSubmi = fals;
/**
* rcovr nod id lis
*/
priva Lis<TaskInsanc> rcovrNodIdLis = nw ArrayLis<>();
/**
* rror ask lis
*/
priva Map<Sring,TaskInsanc> rrorTaskLis = nw ConcurrnHashMap<>();
/**
* compl ask lis
*/
priva Map<Sring, TaskInsanc> complTaskLis = nw ConcurrnHashMap<>();
/**
* rady o submi ask lis
*/
priva Map<Sring, TaskInsanc> radyToSubmiTaskLis = nw ConcurrnHashMap<>();
/**
* dpnd faild ask map
*/
priva Map<Sring, TaskInsanc> dpndFaildTask = nw ConcurrnHashMap<>();
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | * forbiddn ask map
*/
priva Map<Sring, TaskNod> forbiddnTaskLis = nw ConcurrnHashMap<>();
/**
* skip ask map
*/
priva Map<Sring, TaskNod> skipTaskNodLis = nw ConcurrnHashMap<>();
/**
* rcovr olranc faul ask lis
*/
priva Lis<TaskInsanc> rcovrTolrancFaulTaskLis = nw ArrayLis<>();
/**
* alr managr
*/
priva AlrManagr alrManagr = nw AlrManagr();
/**
* h objc of DAG
*/
priva DAG<Sring,TaskNod,TaskNodRlaion> dag;
/**
* procss srvic
*/
priva ProcssSrvic procssSrvic;
/**
* masr config
*/
priva MasrConfig masrConfig;
/**
*
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva NyRmoingClin nyRmoingClin;
/**
* consrucor of MasrExcThrad
* @param procssInsanc procssInsanc
* @param procssSrvic procssSrvic
* @param nyRmoingClin nyRmoingClin
*/
public MasrExcThrad(ProcssInsanc procssInsanc, ProcssSrvic procssSrvic, NyRmoingClin nyRmoingClin){
his.procssSrvic = procssSrvic;
his.procssInsanc = procssInsanc;
his.masrConfig = SpringApplicaionConx.gBan(MasrConfig.class);
in masrTaskExcNum = masrConfig.gMasrExcTaskNum();
his.askExcSrvic = ThradUils.nwDamonFixdThradExcuor("Masr-Task-Exc-Thrad",
masrTaskExcNum);
his.nyRmoingClin = nyRmoingClin;
}
@Ovrrid
public void run() {
if (procssInsanc == null){
loggr.info("procss insanc is no xiss");
rurn;
}
if (procssInsanc.gSa().ypIsFinishd()){
loggr.info("procss insanc is don : {}",procssInsanc.gId());
rurn;
}
ry {
if (procssInsanc.isComplmnDaa() && Flag.NO == procssInsanc.gIsSubProcss()){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | xcuComplmnProcss();
}ls{
xcuProcss();
}
}cach (Excpion ){
loggr.rror("masr xc hrad xcpion", );
loggr.rror("procss xcu faild, procss id:{}", procssInsanc.gId());
procssInsanc.sSa(ExcuionSaus.FAILURE);
procssInsanc.sEndTim(nw Da());
procssSrvic.updaProcssInsanc(procssInsanc);
}finally {
askExcSrvic.shudown();
posHandl();
}
}
/**
* xcu procss
* @hrows Excpion xcpion
*/
priva void xcuProcss() hrows Excpion {
prparProcss();
runProcss();
ndProcss();
}
/**
* xcu complmn procss
* @hrows Excpion xcpion |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | */
priva void xcuComplmnProcss() hrows Excpion {
Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam());
Da sarDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_START_DATE));
Da ndDa = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE));
procssSrvic.savProcssInsanc(procssInsanc);
in procssDfiniionId = procssInsanc.gProcssDfiniionId();
Lis<Schdul> schduls = procssSrvic.quryRlasSchdulrLisByProcssDfiniionId(procssDfiniionId);
Lis<Da> lisDa = Liss.nwLinkdLis();
!CollcionUils.isEmpy(schduls)){
for (Schdul schdul : schduls) {
lisDa.addAll(CronUils.gSlfFirDaLis(sarDa, ndDa, schdul.gCronab()));
}
}
Iraor<Da> iraor = null;
Da schdulDa = null;
!CollcionUils.isEmpy(lisDa)) {
iraor = lisDa.iraor();
schdulDa = iraor.nx();
procssInsanc.sSchdulTim(schdulDa);
procssSrvic.updaProcssInsanc(procssInsanc);
}ls{
schdulDa = procssInsanc.gSchdulTim();
schdulDa == null){
schdulDa = sarDa;
}
}
whil(Soppr.isRunning()){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | loggr.info("procss {} sar o complmn {} daa",
procssInsanc.gId(), DaUils.daToSring(schdulDa));
prparProcss();
dag == null){
loggr.rror("procss {} dag is null, plas chck ou paramrs",
procssInsanc.gId());
procssInsanc.sSa(ExcuionSaus.SUCCESS);
procssSrvic.updaProcssInsanc(procssInsanc);
rurn;
}
runProcss();
ndProcss();
!procssInsanc.gSa().ypIsSuccss()){
loggr.info("procss {} sa {}, complmn no complly!",
procssInsanc.gId(), procssInsanc.gSa());
brak;
}
//
null == iraor){
//
schdulDa = DaUils.gSomDay(schdulDa, 1);
schdulDa.afr(ndDa)){
//
loggr.info("procss {} complmn complly!", procssInsanc.gId());
brak;
}
}ls{ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | //
!iraor.hasNx()){
//
loggr.info("procss {} complmn complly!", procssInsanc.gId());
brak;
}
schdulDa = iraor.nx();
}
// flow nd
//
procssInsanc.sSchdulTim(schdulDa);
cmdParam.conainsKy(Consans.CMDPARAM_RECOVERY_START_NODE_STRING)){
cmdParam.rmov(Consans.CMDPARAM_RECOVERY_START_NODE_STRING);
procssInsanc.sCommandParam(JSONUils.oJson(cmdParam));
}
procssInsanc.sSa(ExcuionSaus.RUNNING_EXEUTION);
procssInsanc.sGlobalParams(ParamrUils.curingGlobalParams(
procssInsanc.gProcssDfiniion().gGlobalParamMap(),
procssInsanc.gProcssDfiniion().gGlobalParamLis(),
CommandTyp.COMPLEMENT_DATA, procssInsanc.gSchdulTim()));
procssInsanc.sId(0);
procssInsanc.sSarTim(nw Da());
procssInsanc.sEndTim(null);
procssSrvic.savProcssInsanc(procssInsanc);
}
}
/**
* prpar procss paramr
* @hrows Excpion xcpion
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva void prparProcss() hrows Excpion {
//
iniTaskQuu();
//
buildFlowDag();
loggr.info("prpar procss :{} nd", procssInsanc.gId());
}
/**
* procss nd handl
*/
priva void ndProcss() {
procssInsanc.sEndTim(nw Da());
procssSrvic.updaProcssInsanc(procssInsanc);
procssInsanc.gSa().ypIsWaiingThrad()){
procssSrvic.craRcovryWaiingThradCommand(null, procssInsanc);
}
Lis<TaskInsanc> askInsancs = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId());
alrManagr.sndAlrProcssInsanc(procssInsanc, askInsancs);
}
/**
*
* @hrows Excpion xcpion
*/
priva void buildFlowDag() hrows Excpion {
rcovrNodIdLis = gSarTaskInsancLis(procssInsanc.gCommandParam());
forbiddnTaskLis = DagHlpr.gForbiddnTaskNodMaps(procssInsanc.gProcssInsancJson());
//
Lis<Sring> rcovryNamLis = gRcovryNodNamLis();
Lis<Sring> sarNodNamLis = parsSarNodNam(procssInsanc.gCommandParam());
ProcssDag procssDag = gnraFlowDag(procssInsanc.gProcssInsancJson(), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | sarNodNamLis, rcovryNamLis, procssInsanc.gTaskDpndTyp());
procssDag == null){
loggr.rror("procssDag is null");
rurn;
}
//
dag = DagHlpr.buildDagGraph(procssDag);
}
/**
*
*/
priva void iniTaskQuu(){
askFaildSubmi = fals;
acivTaskNod.clar();
dpndFaildTask.clar();
complTaskLis.clar();
rrorTaskLis.clar();
Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(procssInsanc.gId());
for(TaskInsanc ask : askInsancLis){
ask.isTaskCompl()){
complTaskLis.pu(ask.gNam(), ask);
}
ask.gSa().ypIsFailur() && !ask.askCanRry()){
rrorTaskLis.pu(ask.gNam(), ask);
}
}
}
/**
* procss pos handl
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva void posHandl() {
loggr.info("dvlop mod is: {}", CommonUils.isDvlopMod());
if (!CommonUils.isDvlopMod()) {
//
Sring xcLocalPah = org.apach.dolphinschdulr.common.uils.FilUils
.gProcssExcDir(procssInsanc.gProcssDfiniion().gProjcId(),
procssInsanc.gProcssDfiniionId(),
procssInsanc.gId());
ry {
FilUils.dlDircory(nw Fil(xcLocalPah));
} cach (IOExcpion ) {
loggr.rror("dl xc dir faild ", );
}
}
}
/**
* submi ask o xcu
* @param askInsanc ask insanc
* @rurn TaskInsanc
*/
priva TaskInsanc submiTaskExc(TaskInsanc askInsanc) {
MasrBasTaskExcThrad absracExcThrad = null;
askInsanc.isSubProcss()){
absracExcThrad = nw SubProcssTaskExcThrad(askInsanc);
}ls askInsanc.isDpndTask()){
absracExcThrad = nw DpndnTaskExcThrad(askInsanc);
}ls askInsanc.isCondiionsTask()){
absracExcThrad = nw CondiionsTaskExcThrad(askInsanc);
}ls {
absracExcThrad = nw MasrTaskExcThrad(askInsanc); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
Fuur<Boolan> fuur = askExcSrvic.submi(absracExcThrad);
acivTaskNod.puIfAbsn(absracExcThrad, fuur);
rurn absracExcThrad.gTaskInsanc();
}
/**
* find ask insanc in db.
* in cas submi mor han on sam nam ask in h sam im.
* @param askNam ask nam
* @rurn TaskInsanc
*/
priva TaskInsanc findTaskIfExiss(Sring askNam){
Lis<TaskInsanc> askInsancLis = procssSrvic.findValidTaskLisByProcssId(his.procssInsanc.gId());
for(TaskInsanc askInsanc : askInsancLis){
askInsanc.gNam().quals(askNam)){
rurn askInsanc;
}
}
rurn null;
}
/**
* ncapsulaion ask
* @param procssInsanc procss insanc
* @param nodNam nod nam
* @rurn TaskInsanc
*/
priva TaskInsanc craTaskInsanc(ProcssInsanc procssInsanc, Sring nodNam,
TaskNod askNod) {
TaskInsanc askInsanc = findTaskIfExiss(nodNam);
askInsanc == null){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | askInsanc = nw TaskInsanc();
// ask nam
askInsanc.sNam(nodNam);
//
askInsanc.sProcssDfiniionId(procssInsanc.gProcssDfiniionId());
//
askInsanc.sSa(ExcuionSaus.SUBMITTED_SUCCESS);
//
askInsanc.sProcssInsancId(procssInsanc.gId());
//
askInsanc.sTaskJson(JSON.oJSONSring(askNod));
//
askInsanc.sTaskTyp(askNod.gTyp());
//
askInsanc.sAlrFlag(Flag.NO);
//
askInsanc.sSarTim(null);
//
askInsanc.sFlag(Flag.YES);
//
askInsanc.sRryTims(0);
//
askInsanc.sMaxRryTims(askNod.gMaxRryTims());
//
askInsanc.sRryInrval(askNod.gRryInrval());
//
askNod.gTaskInsancPrioriy() == null){
askInsanc.sTaskInsancPrioriy(Prioriy.MEDIUM);
}ls{
askInsanc.sTaskInsancPrioriy(askNod.gTaskInsancPrioriy()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
Sring procssWorkrGroup = procssInsanc.gWorkrGroup();
procssWorkrGroup = SringUils.isBlank(procssWorkrGroup) ? DEFAULT_WORKER_GROUP : procssWorkrGroup;
Sring askWorkrGroup = SringUils.isBlank(askNod.gWorkrGroup()) ? procssWorkrGroup : askNod.gWorkrGroup();
if (!procssWorkrGroup.quals(DEFAULT_WORKER_GROUP) && askWorkrGroup.quals(DEFAULT_WORKER_GROUP)) {
askInsanc.sWorkrGroup(procssWorkrGroup);
}ls {
askInsanc.sWorkrGroup(askWorkrGroup);
}
}
rurn askInsanc;
}
/**
* if all of h ask dpndnc ar skip, skip i oo.
* @param askNod
* @rurn
*/
priva boolan isTaskNodNdSkip(TaskNod askNod){
CollcionUils.isEmpy(askNod.gDpLis())){
rurn fals;
}
for(Sring dpNod : askNod.gDpLis()){
!skipTaskNodLis.conainsKy(dpNod)){
rurn fals;
}
}
rurn ru;
}
/**
* s ask nod skip if dpndnc all skip |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | * @param askNodsSkipLis
*/
priva void sTaskNodSkip(Lis<Sring> askNodsSkipLis){
for(Sring skipNod : askNodsSkipLis){
skipTaskNodLis.puIfAbsn(skipNod, dag.gNod(skipNod));
Collcion<Sring> posNodLis = DagHlpr.gSarVrx(skipNod, dag, complTaskLis);
Lis<Sring> posSkipLis = nw ArrayLis<>();
for(Sring pos : posNodLis){
TaskNod posNod = dag.gNod(pos);
isTaskNodNdSkip(posNod)){
posSkipLis.add(pos);
}
}
sTaskNodSkip(posSkipLis);
}
}
/**
* pars condiion ask find h branch procss
* s skip flag for anohr on.
* @param nodNam
* @rurn
*/
priva Lis<Sring> parsCondiionTask(Sring nodNam){
Lis<Sring> condiionTaskLis = nw ArrayLis<>();
TaskNod askNod = dag.gNod(nodNam);
!askNod.isCondiionsTask()){
rurn condiionTaskLis;
}
CondiionsParamrs condiionsParamrs =
JSONUils.parsObjc(askNod.gCondiionRsul(), CondiionsParamrs.class); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | TaskInsanc askInsanc = complTaskLis.g(nodNam);
askInsanc == null){
loggr.rror("ask insanc {} canno find, plas chck i!", nodNam);
rurn condiionTaskLis;
}
askInsanc.gSa().ypIsSuccss()){
condiionTaskLis = condiionsParamrs.gSuccssNod();
sTaskNodSkip(condiionsParamrs.gFaildNod());
}ls askInsanc.gSa().ypIsFailur()){
condiionTaskLis = condiionsParamrs.gFaildNod();
sTaskNodSkip(condiionsParamrs.gSuccssNod());
}ls{
condiionTaskLis.add(nodNam);
}
rurn condiionTaskLis;
}
/**
* pars pos nod lis of prvious nod
* if condiion nod: rurn procss according o h sings
* if pos nod compld, rurn pos nods of h compld nod
* @param prviousNodNam
* @rurn
*/
priva Lis<Sring> parsPosNodLis(Sring prviousNodNam){
Lis<Sring> posNodLis = nw ArrayLis<>();
TaskNod askNod = dag.gNod(prviousNodNam);
askNod != null && askNod.isCondiionsTask()){
rurn parsCondiionTask(prviousNodNam);
}
Collcion<Sring> posNodCollcion = DagHlpr.gSarVrx(prviousNodNam, dag, complTaskLis); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | Lis<Sring> posSkipLis = nw ArrayLis<>();
//
//
//
//
for(Sring posNod : posNodCollcion){
complTaskLis.conainsKy(posNod)){
TaskInsanc posTaskInsanc = complTaskLis.g(posNod);
dag.gNod(posNod).isCondiionsTask()){
Lis<Sring> condiionTaskNodLis = parsCondiionTask(posNod);
for(Sring condiions : condiionTaskNodLis){
posNodLis.addAll(parsPosNodLis(condiions));
}
}ls posTaskInsanc.gSa().ypIsSuccss()){
posNodLis.addAll(parsPosNodLis(posNod));
}ls{
posNodLis.add(posNod);
}
}ls isTaskNodNdSkip(dag.gNod(posNod))){
posSkipLis.add(posNod);
sTaskNodSkip(posSkipLis);
posSkipLis.clar();
}ls{
posNodLis.add(posNod);
}
}
rurn posNodLis;
}
/**
* submi pos nod |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | * @param parnNodNam parn nod nam
*/
priva void submiPosNod(Sring parnNodNam){
Lis<Sring> submiTaskNodLis = parsPosNodLis(parnNodNam);
Lis<TaskInsanc> askInsancs = nw ArrayLis<>();
for(Sring askNod : submiTaskNodLis){
askInsancs.add(craTaskInsanc(procssInsanc, askNod,
dag.gNod(askNod)));
}
//
for(TaskInsanc ask : askInsancs){
radyToSubmiTaskLis.conainsKy(ask.gNam())){
coninu;
}
complTaskLis.conainsKy(ask.gNam())){
loggr.info("ask {} has alrady run succss", ask.gNam());
coninu;
}
ask.gSa().ypIsPaus() || ask.gSa().ypIsCancl()){
loggr.info("ask {} soppd, h sa is {}", ask.gNam(), ask.gSa());
}ls{
addTaskToSandByLis(ask);
}
}
}
/**
* drmin whhr h dpndncis of h ask nod ar compl
* @rurn DpndRsul
*/
priva DpndRsul isTaskDpsCompl(Sring askNam) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | Collcion<Sring> sarNods = dag.gBginNod();
//
sarNods.conains(askNam)){
rurn DpndRsul.SUCCESS;
}
TaskNod askNod = dag.gNod(askNam);
Lis<Sring> dpNamLis = askNod.gDpLis();
for(Sring dpsNod : dpNamLis ){
!dag.conainsNod(dpsNod)
|| skipTaskNodLis.conainsKy(dpsNod)
|| forbiddnTaskLis.conainsKy(dpsNod)){
coninu;
}
//
!complTaskLis.conainsKy(dpsNod)){
rurn DpndRsul.WAITING;
}
ExcuionSaus dpTaskSa = complTaskLis.g(dpsNod).gSa();
dpTaskSa.ypIsPaus() || dpTaskSa.ypIsCancl()){
rurn DpndRsul.WAITING;
}
//
askNod.isCondiionsTask()){
coninu;
}
!dpndTaskSuccss(dpsNod, askNam)){
rurn DpndRsul.FAILED;
}
}
loggr.info("askNam: {} complDpndTaskLis: {}", askNam, Arrays.oSring(complTaskLis.kyS().oArray())); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | rurn DpndRsul.SUCCESS;
}
/**
* dpnd nod is compld, bu hr nd chck h condiion ask branch is h nx nod
* @param dpndNodNam
* @param nxNodNam
* @rurn
*/
priva boolan dpndTaskSuccss(Sring dpndNodNam, Sring nxNodNam){
dag.gNod(dpndNodNam).isCondiionsTask()){
//
Lis<Sring> nxTaskLis = parsCondiionTask(dpndNodNam);
!nxTaskLis.conains(nxNodNam)){
rurn fals;
}
}ls {
ExcuionSaus dpTaskSa = complTaskLis.g(dpndNodNam).gSa();
dpTaskSa.ypIsFailur()){
rurn fals;
}
}
rurn ru;
}
/**
* qury ask insanc by compl sa
* @param sa sa
* @rurn ask insanc lis
*/
priva Lis<TaskInsanc> gComplTaskBySa(ExcuionSaus sa){
Lis<TaskInsanc> rsulLis = nw ArrayLis<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | for (Map.Enry<Sring, TaskInsanc> nry: complTaskLis.nryS()) {
nry.gValu().gSa() == sa){
rsulLis.add(nry.gValu());
}
}
rurn rsulLis;
}
/**
* whr hr ar ongoing asks
* @param sa sa
* @rurn ExcuionSaus
*/
priva ExcuionSaus runningSa(ExcuionSaus sa){
sa == ExcuionSaus.READY_STOP ||
sa == ExcuionSaus.READY_PAUSE ||
sa == ExcuionSaus.WAITTING_THREAD){
//
rurn sa;
}ls{
rurn ExcuionSaus.RUNNING_EXEUTION;
}
}
/**
* xiss failur ask,conains submi failur、dpndncy failur,xcu failur(rry afr)
*
* @rurn Boolan whhr has faild ask
*/
priva boolan hasFaildTask(){
his.askFaildSubmi){
rurn ru; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
his.rrorTaskLis.siz() > 0){
rurn ru;
}
rurn his.dpndFaildTask.siz() > 0;
}
/**
* procss insanc failur
*
* @rurn Boolan whhr procss insanc faild
*/
priva boolan procssFaild(){
hasFaildTask()) {
procssInsanc.gFailurSragy() == FailurSragy.END){
rurn ru;
}
if (procssInsanc.gFailurSragy() == FailurSragy.CONTINUE) {
rurn radyToSubmiTaskLis.siz() == 0 || acivTaskNod.siz() == 0;
}
}
rurn fals;
}
/**
* whhr ask for waiing hrad
* @rurn Boolan whhr has waiing hrad ask
*/
priva boolan hasWaiingThradTask(){
Lis<TaskInsanc> waiingLis = gComplTaskBySa(ExcuionSaus.WAITTING_THREAD);
rurn CollcionUils.isNoEmpy(waiingLis);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | /**
* prpar for paus
* 1,faild rry ask in h prparaion quu , rurns o failur dircly
* 2,xiss paus ask,complmn no compld, pnding submission of asks, rurn o suspnsion
* 3,succss
* @rurn ExcuionSaus
*/
priva ExcuionSaus procssRadyPaus(){
hasRryTaskInSandBy()){
rurn ExcuionSaus.FAILURE;
}
Lis<TaskInsanc> pausLis = gComplTaskBySa(ExcuionSaus.PAUSE);
CollcionUils.isNoEmpy(pausLis)
|| !isComplmnEnd()
|| radyToSubmiTaskLis.siz() > 0){
rurn ExcuionSaus.PAUSE;
}ls{
rurn ExcuionSaus.SUCCESS;
}
}
/**
* gnra h las procss insanc saus by h asks sa
* @rurn procss insanc xcuion saus
*/
priva ExcuionSaus gProcssInsancSa(){
ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId());
ExcuionSaus sa = insanc.gSa();
acivTaskNod.siz() > 0 || rryTaskExiss()){
// aciv a
rurn runningSa(sa); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
// procss failur
procssFaild()){
rurn ExcuionSaus.FAILURE;
}
// waiing hrad
hasWaiingThradTask()){
rurn ExcuionSaus.WAITTING_THREAD;
}
// paus
sa == ExcuionSaus.READY_PAUSE){
rurn procssRadyPaus();
}
// sop
sa == ExcuionSaus.READY_STOP){
Lis<TaskInsanc> sopLis = gComplTaskBySa(ExcuionSaus.STOP);
Lis<TaskInsanc> killLis = gComplTaskBySa(ExcuionSaus.KILL);
CollcionUils.isNoEmpy(sopLis)
|| CollcionUils.isNoEmpy(killLis)
|| !isComplmnEnd()){
rurn ExcuionSaus.STOP;
}ls{
rurn ExcuionSaus.SUCCESS;
}
}
// succss
sa == ExcuionSaus.RUNNING_EXEUTION){
Lis<TaskInsanc> killTasks = gComplTaskBySa(ExcuionSaus.KILL);
radyToSubmiTaskLis.siz() > 0){
//asks curr |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | rurn ExcuionSaus.RUNNING_EXEUTION;
}ls CollcionUils.isNoEmpy(killTasks)){
// asks may
rurn ExcuionSaus.FAILURE;
}ls{
// if h w
rurn ExcuionSaus.SUCCESS;
}
}
rurn sa;
}
/**
* whhr sandby ask lis hav rry asks
* @rurn
*/
priva boolan rryTaskExiss() {
boolan rsul = fals;
for(Sring askNam : radyToSubmiTaskLis.kyS()){
TaskInsanc ask = radyToSubmiTaskLis.g(askNam);
ask.gSa().ypIsFailur()){
rsul = ru;
brak;
}
}
rurn rsul;
}
/**
* whhr complmn nd
* @rurn Boolan whhr is complmn nd
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva boolan isComplmnEnd() {
!procssInsanc.isComplmnDaa()){
rurn ru;
}
ry {
Map<Sring, Sring> cmdParam = JSONUils.oMap(procssInsanc.gCommandParam());
Da ndTim = DaUils.gSchdulDa(cmdParam.g(CMDPARAM_COMPLEMENT_DATA_END_DATE));
rurn procssInsanc.gSchdulTim().quals(ndTim);
} cach (Excpion ) {
loggr.rror("complmn nd faild ",);
rurn fals;
}
}
/**
* updaProcssInsanc procss insanc sa
* afr ach bach of asks is xcud, h saus of h procss insanc is updad
*/
priva void updaProcssInsancSa() {
ExcuionSaus sa = gProcssInsancSa();
procssInsanc.gSa() != sa){
loggr.info(
"work flow procss insanc [id: {}, nam:{}], sa chang from {} o {}, cmd yp: {}",
procssInsanc.gId(), procssInsanc.gNam(),
procssInsanc.gSa(), sa,
procssInsanc.gCommandTyp());
ProcssInsanc insanc = procssSrvic.findProcssInsancById(procssInsanc.gId());
insanc.sSa(sa);
insanc.sProcssDfiniion(procssInsanc.gProcssDfiniion());
procssSrvic.updaProcssInsanc(insanc);
procssInsanc = insanc; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
}
/**
* g ask dpndncy rsul
* @param askInsanc ask insanc
* @rurn DpndRsul
*/
priva DpndRsul gDpndRsulForTask(TaskInsanc askInsanc){
rurn isTaskDpsCompl(askInsanc.gNam());
}
/**
* add ask o sandby lis
* @param askInsanc ask insanc
*/
priva void addTaskToSandByLis(TaskInsanc askInsanc){
loggr.info("add ask o sand by lis: {}", askInsanc.gNam());
radyToSubmiTaskLis.puIfAbsn(askInsanc.gNam(), askInsanc);
}
/**
* rmov ask from sand by lis
* @param askInsanc ask insanc
*/
priva void rmovTaskFromSandbyLis(TaskInsanc askInsanc){
loggr.info("rmov ask from sand by lis: {}", askInsanc.gNam());
radyToSubmiTaskLis.rmov(askInsanc.gNam());
}
/**
* has rry ask in sandby
* @rurn Boolan whhr has rry ask in sandby
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | priva boolan hasRryTaskInSandBy(){
for (Map.Enry<Sring, TaskInsanc> nry: radyToSubmiTaskLis.nryS()) {
nry.gValu().gSa().ypIsFailur()){
rurn ru;
}
}
rurn fals;
}
/**
* submi and wach h asks, unil h work flow sop
*/
priva void runProcss(){
// submi sar nod
submiPosNod(null);
boolan sndTimWarning = fals;
whil(!procssInsanc.isProcssInsancSop() && Soppr.isRunning()){
// snd warn
!sndTimWarning && chckProcssTimOu(procssInsanc) ){
alrManagr.sndProcssTimouAlr(procssInsanc,
procssSrvic.findProcssDfinById(procssInsanc.gProcssDfiniionId()));
sndTimWarning = ru;
}
for(Map.Enry<MasrBasTaskExcThrad,Fuur<Boolan>> nry: acivTaskNod.nryS()) {
Fuur<Boolan> fuur = nry.gValu();
TaskInsanc ask = nry.gKy().gTaskInsanc();
!fuur.isDon()){
coninu;
}
// nod moni
ask = his.procssSrvic.findTaskInsancById(ask.gId()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | ask == null){
his.askFaildSubmi = ru;
acivTaskNod.rmov(nry.gKy());
coninu;
}
// nod moni
ask.gSa().ypIsFinishd()){
acivTaskNod.rmov(nry.gKy());
}
loggr.info("ask :{}, id:{} compl, sa is {} ",
ask.gNam(), ask.gId(), ask.gSa());
// nod succ
ask.gSa() == ExcuionSaus.SUCCESS){
complTaskLis.pu(ask.gNam(), ask);
submiPosNod(ask.gNam());
coninu;
}
// nod fail
ask.gSa().ypIsFailur()){
ask.gSa() == ExcuionSaus.NEED_FAULT_TOLERANCE){
his.rcovrTolrancFaulTaskLis.add(ask);
}
ask.askCanRry()){
addTaskToSandByLis(ask);
}ls{
complTaskLis.pu(ask.gNam(), ask);
ask.isCondiionsTask()
|| DagHlpr.havCondiionsAfrNod(ask.gNam(), dag)) {
submiPosNod(ask.gNam());
}ls{ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | rrorTaskLis.pu(ask.gNam(), ask);
procssInsanc.gFailurSragy() == FailurSragy.END){
killThOhrTasks();
}
}
}
coninu;
}
// ohr sa
complTaskLis.pu(ask.gNam(), ask);
}
// snd alr
CollcionUils.isNoEmpy(his.rcovrTolrancFaulTaskLis)){
alrManagr.sndAlrWorkrTolrancFaul(procssInsanc, rcovrTolrancFaulTaskLis);
his.rcovrTolrancFaulTaskLis.clar();
}
// updaPro
// failur p
// if a ask
rrorTaskLis.siz() > 0){
for(Map.Enry<Sring, TaskInsanc> nry: complTaskLis.nryS()) {
TaskInsanc complTask = nry.gValu();
complTask.gSa()== ExcuionSaus.PAUSE){
complTask.sSa(ExcuionSaus.KILL);
complTaskLis.pu(nry.gKy(), complTask);
procssSrvic.updaTaskInsanc(complTask);
}
}
}
canSubmiTaskToQuu()){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | submiSandByTask();
}
ry {
Thrad.slp(Consans.SLEEP_TIME_MILLIS);
} cach (InrrupdExcpion ) {
loggr.rror(.gMssag(),);
}
updaProcssInsancSa();
}
loggr.info("procss:{} nd, sa :{}", procssInsanc.gId(), procssInsanc.gSa());
}
/**
* whhr chck procss im ou
* @param procssInsanc ask insanc
* @rurn ru if im ou of procss insanc > running im of procss insanc
*/
priva boolan chckProcssTimOu(ProcssInsanc procssInsanc) {
procssInsanc.gTimou() == 0 ){
rurn fals;
}
Da now = nw Da();
long runningTim = DaUils.diffMin(now, procssInsanc.gSarTim());
rurn runningTim > procssInsanc.gTimou();
}
/**
* whhr can submi ask o quu
* @rurn boolan
*/
priva boolan canSubmiTaskToQuu() {
rurn OSUils.chckRsourc(masrConfig.gMasrMaxCpuloadAvg(), masrConfig.gMasrRsrvdMmory()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
/**
* clos h on going asks
*/
priva void killThOhrTasks() {
loggr.info("kill calld on : {}, num: {}", procssInsanc.gId(),
acivTaskNod.siz());
for (Map.Enry<MasrBasTaskExcThrad, Fuur<Boolan>> nry : acivTaskNod.nryS()) {
MasrBasTaskExcThrad askExcThrad = nry.gKy();
Fuur<Boolan> fuur = nry.gValu();
TaskInsanc askInsanc = askExcThrad.gTaskInsanc();
askInsanc = procssSrvic.findTaskInsancById(askInsanc.gId());
askInsanc != null && askInsanc.gSa().ypIsFinishd()){
coninu;
}
if (!fuur.isDon()) {
// rcord ki
loggr.info("kill procss insanc, id: {}, ask: {}", procssInsanc.gId(), askExcThrad.gTaskInsanc().gId());
// kill nod
askExcThrad.kill();
}
}
}
/**
* whhr h rry inrval is imd ou
* @param askInsanc ask insanc
* @rurn Boolan
*/
priva boolan rryTaskInrvalOvrTim(TaskInsanc askInsanc){
askInsanc.gSa() != ExcuionSaus.FAILURE){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | rurn ru;
}
askInsanc.gId() == 0 ||
askInsanc.gMaxRryTims() ==0 ||
askInsanc.gRryInrval() == 0 ){
rurn ru;
}
Da now = nw Da();
long faildTimInrval = DaUils.diffrSc(now, askInsanc.gEndTim());
// ask rry dos no ovr im, rurn fals
rurn askInsanc.gRryInrval() * SEC_2_MINUTES_TIME_UNIT < faildTimInrval;
}
/**
* handling h lis of asks o b submid
*/
priva void submiSandByTask(){
for(Map.Enry<Sring, TaskInsanc> nry: radyToSubmiTaskLis.nryS()) {
TaskInsanc ask = nry.gValu();
DpndRsul dpndRsul = gDpndRsulForTask(ask);
DpndRsul.SUCCESS == dpndRsul){
rryTaskInrvalOvrTim(ask)){
submiTaskExc(ask);
rmovTaskFromSandbyLis(ask);
}
}ls DpndRsul.FAILED == dpndRsul){
// if h d
dpndFaildTask.pu(nry.gKy(), ask);
rmovTaskFromSandbyLis(ask);
loggr.info("ask {},id:{} dpnd rsul : {}",ask.gNam(), ask.gId(), dpndRsul);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | }
}
/**
* g rcovry ask insanc
* @param askId ask id
* @rurn rcovry ask insanc
*/
priva TaskInsanc gRcovryTaskInsanc(Sring askId){
!SringUils.isNoEmpy(askId)){
rurn null;
}
ry {
Ingr inId = Ingr.valuOf(askId);
TaskInsanc ask = procssSrvic.findTaskInsancById(inId);
ask == null){
loggr.rror("sar nod id canno b found: {}", askId);
}ls {
rurn ask;
}
}cach (Excpion ){
loggr.rror("g rcovry ask insanc faild ",);
}
rurn null;
}
/**
* g sar ask insanc lis
* @param cmdParam command param
* @rurn ask insanc lis
*/
priva Lis<TaskInsanc> gSarTaskInsancLis(Sring cmdParam){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | Lis<TaskInsanc> insancLis = nw ArrayLis<>();
Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam);
paramMap != null && paramMap.conainsKy(CMDPARAM_RECOVERY_START_NODE_STRING)){
Sring[] idLis = paramMap.g(CMDPARAM_RECOVERY_START_NODE_STRING).spli(Consans.COMMA);
for(Sring nodId : idLis){
TaskInsanc ask = gRcovryTaskInsanc(nodId);
ask != null){
insancLis.add(ask);
}
}
}
rurn insancLis;
}
/**
* pars "SarNodNamLis" from cmd param
* @param cmdParam command param
* @rurn sar nod nam lis
*/
priva Lis<Sring> parsSarNodNam(Sring cmdParam){
Lis<Sring> sarNodNamLis = nw ArrayLis<>();
Map<Sring, Sring> paramMap = JSONUils.oMap(cmdParam);
paramMap == null){
rurn sarNodNamLis;
}
paramMap.conainsKy(CMDPARAM_START_NODE_NAMES)){
sarNodNamLis = Arrays.asLis(paramMap.g(CMDPARAM_START_NODE_NAMES).spli(Consans.COMMA));
}
rurn sarNodNamLis;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/runner/MasterExecThread.java | * gnra sar nod nam lis from parsing command param;
* if "SarNodIdLis" xiss in command param, rurn SarNodIdLis
* @rurn rcovry nod nam lis
*/
priva Lis<Sring> gRcovryNodNamLis(){
Lis<Sring> rcovryNodNamLis = nw ArrayLis<>();
CollcionUils.isNoEmpy(rcovrNodIdLis)) {
for (TaskInsanc ask : rcovrNodIdLis) {
rcovryNodNamLis.add(ask.gNam());
}
}
rurn rcovryNodNamLis;
}
/**
* gnra flow dag
* @param procssDfiniionJson procss dfiniion json
* @param sarNodNamLis sar nod nam lis
* @param rcovryNodNamLis rcovry nod nam lis
* @param dpNodTyp dpnd nod yp
* @rurn ProcssDag procss dag
* @hrows Excpion xcpion
*/
public ProcssDag gnraFlowDag(Sring procssDfiniionJson,
Lis<Sring> sarNodNamLis,
Lis<Sring> rcovryNodNamLis,
TaskDpndTyp dpNodTyp)hrows Excpion{
rurn DagHlpr.gnraFlowDag(procssDfiniionJson, sarNodNamLis, rcovryNodNamLis, dpNodTyp);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/MasterCommandTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.master; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/MasterCommandTest.java | import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.graph.DAG;
import org.apache.dolphinscheduler.common.model.TaskNode;
import org.apache.dolphinscheduler.common.model.TaskNodeRelation;
import org.apache.dolphinscheduler.common.process.ProcessDag;
import org.apache.dolphinscheduler.dao.entity.Command;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.mapper.CommandMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.utils.DagHelper;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
/**
* master test
*/
@Ignore
public class MasterCommandTest {
private final Logger logger = LoggerFactory.getLogger(MasterCommandTest.class);
private CommandMapper commandMapper;
private ProcessDefinitionMapper processDefinitionMapper;
@Test
public void StartFromFailedCommand(){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/MasterCommandTest.java | Command cmd = new Command();
cmd.setCommandType(CommandType.START_FAILURE_TASK_PROCESS);
cmd.setCommandParam("{\"ProcessInstanceId\":325}");
cmd.setProcessDefinitionId(63);
commandMapper.insert(cmd);
}
@Test
public void RecoverSuspendCommand(){
Command cmd = new Command();
cmd.setProcessDefinitionId(44);
cmd.setCommandParam("{\"ProcessInstanceId\":290}");
cmd.setCommandType(CommandType.RECOVER_SUSPENDED_PROCESS);
commandMapper.insert(cmd);
}
@Test
public void startNewProcessCommand(){
Command cmd = new Command();
cmd.setCommandType(CommandType.START_PROCESS);
cmd.setProcessDefinitionId(167);
cmd.setFailureStrategy(FailureStrategy.CONTINUE);
cmd.setWarningType(WarningType.NONE);
cmd.setWarningGroupId(4);
cmd.setExecutorId(19);
commandMapper.insert(cmd);
}
@Test
public void ToleranceCommand(){
Command cmd = new Command();
cmd.setCommandType(CommandType.RECOVER_TOLERANCE_FAULT_PROCESS);
cmd.setCommandParam("{\"ProcessInstanceId\":816}"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,929 | [Bug][master/worker] After the master and worker are fault-tolerant, the process instance fails after the task instance is successfully executed | ### Steps to reproduce
1. Start 2 master services (master1, master2), 2 worker services (worker1, worker2)
2. Run the workflow, the process instance runs in master1, and the task runs in worker1
3. Stop master1, worker1 services
4. After fault tolerance, the process instance runs on master2 and the task runs on worker2. After all tasks are executed successfully, the process instance status is failed
============================================
### 复现步骤
1.启动2个master服务(master1,master2)、2个worker服务(worker1,worker2)
2.运行工作流,流程实例在master1运行,任务在worker1运行
3.停止master1,worker1服务
4.容错后,流程实例在master2运行,任务在worker2运行,所有任务执行成功后,流程实例状态为失败



**Which branch**
-[1.3.3-release] | https://github.com/apache/dolphinscheduler/issues/3929 | https://github.com/apache/dolphinscheduler/pull/3999 | c11d97f7786eb72d601769a2ba3e1f97453f7c87 | 6caac0f36623cee4fa1cb2edfc35c7db87b08aa9 | "2020-10-16T08:52:08Z" | java | "2020-10-27T09:37:59Z" | dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/MasterCommandTest.java | cmd.setProcessDefinitionId(15);
commandMapper.insert(cmd);
}
@Test
public void insertCommand(){
Command cmd = new Command();
cmd.setCommandType(CommandType.START_PROCESS);
cmd.setFailureStrategy(FailureStrategy.CONTINUE);
cmd.setWarningType(WarningType.ALL);
cmd.setProcessDefinitionId(72);
cmd.setExecutorId(10);
commandMapper.insert(cmd);
}
@Test
public void testDagHelper(){
ProcessDefinition processDefinition = processDefinitionMapper.selectById(19);
try {
ProcessDag processDag = DagHelper.generateFlowDag(processDefinition.getProcessDefinitionJson(),
new ArrayList<>(), new ArrayList<>(), TaskDependType.TASK_POST);
DAG<String,TaskNode,TaskNodeRelation> dag = DagHelper.buildDagGraph(processDag);
Collection<String> start = DagHelper.getStartVertex("1", dag, null);
System.out.println(start.toString());
Map<String, TaskNode> forbidden = DagHelper.getForbiddenTaskNodeMaps(processDefinition.getProcessDefinitionJson());
System.out.println(forbidden);
} catch (Exception e) {
e.printStackTrace();
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import org.apache.dolphinscheduler.api.enums.Status; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.ResourcesService;
import org.apache.dolphinscheduler.api.service.UdfFuncService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ResourceType;
import org.apache.dolphinscheduler.common.enums.UdfType;
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.dao.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import static org.apache.dolphinscheduler.api.enums.Status.*;
/**
* resources controller
*/
@Api(tags = "RESOURCES_TAG", position = 1) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RestController
@RequestMapping("resources")
public class ResourcesController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(ResourcesController.class);
@Autowired
private ResourcesService resourceService;
@Autowired
private UdfFuncService udfFuncService;
/**
* create directory
*
* @param loginUser login user
* @param alias alias
* @param description description |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * @param type type
* @return create result code
*/
/**
* @param loginUser login user
* @param type type
* @param alias alias
* @param description description
* @param pid parent id
* @param currentDir current directory
* @return
*/
@ApiOperation(value = "createDirctory", notes = "CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
})
@PostMapping(value = "/directory/create")
@ApiException(CREATE_RESOURCE_ERROR)
public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir) {
logger.info("login user {}, create resource, type: {}, resource alias: {}, desc: {}, file: {},{}",
loginUser.getUserName(), type, alias, description, pid, currentDir);
return resourceService.createDirectory(loginUser, alias, description, type, pid, currentDir); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | }
/**
* create resource
*
* @param loginUser login user
* @param alias alias
* @param description description
* @param type type
* @param file file
* @return create result code
*/
@ApiOperation(value = "createResource", notes = "CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
})
@PostMapping(value = "/create")
@ApiException(CREATE_RESOURCE_ERROR)
public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam("file") MultipartFile file,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir) {
logger.info("login user {}, create resource, type: {}, resource alias: {}, desc: {}, file: {},{}",
loginUser.getUserName(), type, alias, description, file.getName(), file.getOriginalFilename());
return resourceService.createResource(loginUser, alias, description, type, file, pid, currentDir); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | }
/**
* update resource
*
* @param loginUser login user
* @param alias alias
* @param resourceId resource id
* @param type resource type
* @param description description
* @return update result code
*/
@ApiOperation(value = "updateResource", notes = "UPDATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String")
})
@PostMapping(value = "/update")
@ApiException(UPDATE_RESOURCE_ERROR)
public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description) {
logger.info("login user {}, update resource, type: {}, resource alias: {}, desc: {}",
loginUser.getUserName(), type, alias, description);
return resourceService.updateResource(loginUser, resourceId, alias, description, type);
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * query resources list
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryResourceList", notes = "QUERY_RESOURCE_LIST_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
})
@GetMapping(value = "/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_ERROR)
public Result queryResourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type
) {
logger.info("query resource list, login user:{}, resource type:{}", loginUser.getUserName(), type);
Map<String, Object> result = resourceService.queryResourceList(loginUser, type);
return returnDataList(result);
}
/**
* query resources list paging
*
* @param loginUser login user
* @param type resource type
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return resource list page
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ApiOperation(value = "queryResourceListPaging", notes = "QUERY_RESOURCE_LIST_PAGING_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "int"),
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataType = "Int", example = "20")
})
@GetMapping(value = "/list-paging")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_PAGING)
public Result queryResourceListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "id") int id,
@RequestParam("pageNo") Integer pageNo,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageSize") Integer pageSize
) {
logger.info("query resource list, login user:{}, resource type:{}, search value:{}",
loginUser.getUserName(), type, searchVal);
Map<String, Object> result = checkPageParams(pageNo, pageSize);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return returnDataListPaging(result);
}
searchVal = ParameterUtils.handleEscapes(searchVal);
result = resourceService.queryResourceListPaging(loginUser, id, type, searchVal, pageNo, pageSize);
return returnDataListPaging(result);
}
/**
* delete resource |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | *
* @param loginUser login user
* @param resourceId resource id
* @return delete result code
*/
@ApiOperation(value = "deleteResource", notes = "DELETE_RESOURCE_BY_ID_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/delete")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_RESOURCE_ERROR)
public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId
) throws Exception {
logger.info("login user {}, delete resource id: {}",
loginUser.getUserName(), resourceId);
return resourceService.delete(loginUser, resourceId);
}
/**
* verify resource by alias and type
*
* @param loginUser login user
* @param fullName resource full name
* @param type resource type
* @return true if the resource name not exists, otherwise return false
*/
@ApiOperation(value = "verifyResourceName", notes = "VERIFY_RESOURCE_NAME_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String")
})
@GetMapping(value = "/verify-name")
@ResponseStatus(HttpStatus.OK)
@ApiException(VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR)
public Result verifyResourceName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "fullName") String fullName,
@RequestParam(value = "type") ResourceType type
) {
logger.info("login user {}, verfiy resource alias: {},resource type: {}",
loginUser.getUserName(), fullName, type);
return resourceService.verifyResourceName(fullName, type, loginUser);
}
/**
* query resources jar list
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryResourceJarList", notes = "QUERY_RESOURCE_LIST_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
})
@GetMapping(value = "/list/jar")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_ERROR)
public Result queryResourceJarList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type
) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | logger.info("query resource list, login user:{}, resource type:{}", loginUser.getUserName(), type.toString());
Map<String, Object> result = resourceService.queryResourceJarList(loginUser, type);
return returnDataList(result);
}
/**
* query resource by full name and type
*
* @param loginUser login user
* @param fullName resource full name
* @param type resource type
* @return true if the resource name not exists, otherwise return false
*/
@ApiOperation(value = "queryResource", notes = "QUERY_BY_RESOURCE_NAME")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String")
})
@GetMapping(value = "/queryResource")
@ResponseStatus(HttpStatus.OK)
@ApiException(RESOURCE_NOT_EXIST)
public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "fullName", required = false) String fullName,
@RequestParam(value = "id", required = false) Integer id,
@RequestParam(value = "type") ResourceType type
) {
logger.info("login user {}, query resource by full name: {} or id: {},resource type: {}",
loginUser.getUserName(), fullName, id, type);
return resourceService.queryResource(fullName, id, type);
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * view resource file online
*
* @param loginUser login user
* @param resourceId resource id
* @param skipLineNum skip line number
* @param limit limit
* @return resource content
*/
@ApiOperation(value = "viewResource", notes = "VIEW_RESOURCE_BY_ID_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/view")
@ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR)
public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId,
@RequestParam(value = "skipLineNum") int skipLineNum,
@RequestParam(value = "limit") int limit
) {
logger.info("login user {}, view resource : {}, skipLineNum {} , limit {}",
loginUser.getUserName(), resourceId, skipLineNum, limit);
return resourceService.readResource(resourceId, skipLineNum, limit);
}
/**
* create resource file online
*
* @param loginUser login user
* @param type resource type |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * @param fileName file name
* @param fileSuffix file suffix
* @param description description
* @param content content
* @return create result code
*/
@ApiOperation(value = "onlineCreateResource", notes = "ONLINE_CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "fileName", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "suffix", value = "SUFFIX", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String")
})
@PostMapping(value = "/online-create")
@ApiException(CREATE_RESOURCE_FILE_ON_LINE_ERROR)
public Result onlineCreateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "fileName") String fileName,
@RequestParam(value = "suffix") String fileSuffix,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "content") String content,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir
) {
logger.info("login user {}, online create resource! fileName : {}, type : {}, suffix : {},desc : {},content : {}",
loginUser.getUserName(), fileName, type, fileSuffix, description, content, pid, currentDir);
if (StringUtils.isEmpty(content)) {
logger.error("resource file contents are not allowed to be empty");
return error(Status.RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | }
return resourceService.onlineCreateResource(loginUser, type, fileName, fileSuffix, description, content, pid, currentDir);
}
/**
* edit resource file online
*
* @param loginUser login user
* @param resourceId resource id
* @param content content
* @return update result code
*/
@ApiOperation(value = "updateResourceContent", notes = "UPDATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String")
})
@PostMapping(value = "/update-content")
@ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR)
public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId,
@RequestParam(value = "content") String content
) {
logger.info("login user {}, updateProcessInstance resource : {}",
loginUser.getUserName(), resourceId);
if (StringUtils.isEmpty(content)) {
logger.error("The resource file contents are not allowed to be empty");
return error(Status.RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg());
}
return resourceService.updateResourceContent(resourceId, content);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | /**
* download resource file
*
* @param loginUser login user
* @param resourceId resource id
* @return resource content
*/
@ApiOperation(value = "downloadResource", notes = "DOWNLOAD_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/download")
@ResponseBody
@ApiException(DOWNLOAD_RESOURCE_FILE_ERROR)
public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int resourceId) throws Exception {
logger.info("login user {}, download resource : {}",
loginUser.getUserName(), resourceId);
Resource file = resourceService.downloadResource(resourceId);
if (file == null) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Status.RESOURCE_NOT_EXIST.getMsg());
}
return ResponseEntity
.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getFilename() + "\"")
.body(file);
}
/**
* create udf function
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * @param loginUser login user
* @param type udf type
* @param funcName function name
* @param argTypes argument types
* @param database database
* @param description description
* @param className class name
* @param resourceId resource id
* @return create result code
*/
@ApiOperation(value = "createUdfFunc", notes = "CREATE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType"),
@ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "suffix", value = "CLASS_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType = "String"),
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType = "String"),
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType = "String"),
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@PostMapping(value = "/udf-func/create")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_UDF_FUNCTION_ERROR)
public Result createUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") UdfType type,
@RequestParam(value = "funcName") String funcName,
@RequestParam(value = "className") String className,
@RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "resourceId") int resourceId) {
logger.info("login user {}, create udf function, type: {}, funcName: {},argTypes: {} ,database: {},desc: {},resourceId: {}",
loginUser.getUserName(), type, funcName, argTypes, database, description, resourceId);
return udfFuncService.createUdfFunction(loginUser, funcName, className, argTypes, database, description, type, resourceId);
}
/**
* view udf function
*
* @param loginUser login user
* @param id resource id
* @return udf function detail
*/
@ApiOperation(value = "viewUIUdfFunction", notes = "VIEW_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/udf-func/update-ui")
@ResponseStatus(HttpStatus.OK)
@ApiException(VIEW_UDF_FUNCTION_ERROR)
public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("id") int id) {
logger.info("login user {}, query udf{}",
loginUser.getUserName(), id);
Map<String, Object> map = udfFuncService.queryUdfFuncDetail(id);
return returnDataList(map);
}
/**
* update udf function
*
* @param loginUser login user |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * @param type resource type
* @param funcName function name
* @param argTypes argument types
* @param database data base
* @param description description
* @param resourceId resource id
* @param className class name
* @param udfFuncId udf function id
* @return update result code
*/
@ApiOperation(value = "updateUdfFunc", notes = "UPDATE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType"),
@ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "suffix", value = "CLASS_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType = "String"),
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType = "String"),
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType = "String"),
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@PostMapping(value = "/udf-func/update")
@ApiException(UPDATE_UDF_FUNCTION_ERROR)
public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int udfFuncId,
@RequestParam(value = "type") UdfType type,
@RequestParam(value = "funcName") String funcName,
@RequestParam(value = "className") String className,
@RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "resourceId") int resourceId) {
logger.info("login user {}, updateProcessInstance udf function id: {},type: {}, funcName: {},argTypes: {} ,database: {},desc: {},resourceId: {}",
loginUser.getUserName(), udfFuncId, type, funcName, argTypes, database, description, resourceId);
Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId, funcName, className, argTypes, database, description, type, resourceId);
return returnDataList(result);
}
/**
* query udf function list paging
*
* @param loginUser login user
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return udf function list page
*/
@ApiOperation(value = "queryUdfFuncListPaging", notes = "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", dataType = "Int", example = "20")
})
@GetMapping(value = "/udf-func/list-paging")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR)
public Result queryUdfFuncList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("pageNo") Integer pageNo,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageSize") Integer pageSize
) {
logger.info("query udf functions list, login user:{},search value:{}", |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | loginUser.getUserName(), searchVal);
Map<String, Object> result = checkPageParams(pageNo, pageSize);
if (result.get(Constants.STATUS) != Status.SUCCESS) {
return returnDataListPaging(result);
}
result = udfFuncService.queryUdfFuncListPaging(loginUser, searchVal, pageNo, pageSize);
return returnDataListPaging(result);
}
/**
* query resource list by type
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryResourceList", notes = "QUERY_RESOURCE_LIST_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType")
})
@GetMapping(value = "/udf-func/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_DATASOURCE_BY_TYPE_ERROR)
public Result queryResourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("type") UdfType type) {
logger.info("query datasource list, user:{}, type:{}", loginUser.getUserName(), type);
Map<String, Object> result = udfFuncService.queryResourceList(loginUser, type.ordinal());
return returnDataList(result);
}
/**
* verify udf function name can use or not |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | *
* @param loginUser login user
* @param name name
* @return true if the name can user, otherwise return false
*/
@ApiOperation(value = "verifyUdfFuncName", notes = "VERIFY_UDF_FUNCTION_NAME_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "FUNC_NAME", required = true, dataType = "String")
})
@GetMapping(value = "/udf-func/verify-name")
@ResponseStatus(HttpStatus.OK)
@ApiException(VERIFY_UDF_FUNCTION_NAME_ERROR)
public Result verifyUdfFuncName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "name") String name
) {
logger.info("login user {}, verfiy udf function name: {}",
loginUser.getUserName(), name);
return udfFuncService.verifyUdfFuncByName(name);
}
/**
* delete udf function
*
* @param loginUser login user
* @param udfFuncId udf function id
* @return delete result code
*/
@ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
}) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @GetMapping(value = "/udf-func/delete")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_UDF_FUNCTION_ERROR)
public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "id") int udfFuncId
) {
logger.info("login user {}, delete udf function id: {}", loginUser.getUserName(), udfFuncId);
return udfFuncService.delete(udfFuncId);
}
/**
* authorized file resource list
*
* @param loginUser login user
* @param userId user id
* @return authorized result
*/
@ApiOperation(value = "authorizedFile", notes = "AUTHORIZED_FILE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authed-file")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZED_FILE_RESOURCE_ERROR)
public Result authorizedFile(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
logger.info("authorized file resource, user: {}, user id:{}", loginUser.getUserName(), userId);
Map<String, Object> result = resourceService.authorizedFile(loginUser, userId);
return returnDataList(result);
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * unauthorized file resource list
*
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
@ApiOperation(value = "authorizeResourceTree", notes = "AUTHORIZE_RESOURCE_TREE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authorize-resource-tree")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZE_RESOURCE_TREE)
public Result authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
logger.info("all resource file, user:{}, user id:{}", loginUser.getUserName(), userId);
Map<String, Object> result = resourceService.authorizeResourceTree(loginUser, userId);
return returnDataList(result);
}
/**
* unauthorized udf function
*
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
@ApiOperation(value = "unauthUDFFunc", notes = "UNAUTHORIZED_UDF_FUNC_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
}) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 4,008 | [Improvement][Swagger] The resources API document does not match the interface parameters |
The resources API document does not match the interface parameters
| https://github.com/apache/dolphinscheduler/issues/4008 | https://github.com/apache/dolphinscheduler/pull/4009 | c54d09605b262b9e1058199834b4b6c80a2ed7f5 | f4c14dea53dada047b1833bdeceaa881ae0d6ff4 | "2020-10-29T07:50:34Z" | java | "2020-11-02T02:08:23Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @GetMapping(value = "/unauth-udf-func")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(UNAUTHORIZED_UDF_FUNCTION_ERROR)
public Result unauthUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
logger.info("unauthorized udf function, login user:{}, unauthorized user id:{}", loginUser.getUserName(), userId);
Map<String, Object> result = resourceService.unauthorizedUDFFunction(loginUser, userId);
return returnDataList(result);
}
/**
* authorized udf function
*
* @param loginUser login user
* @param userId user id
* @return authorized result code
*/
@ApiOperation(value = "authUDFFunc", notes = "AUTHORIZED_UDF_FUNC_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authed-udf-func")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZED_UDF_FUNCTION_ERROR)
public Result authorizedUDFFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
logger.info("auth udf function, login user:{}, auth user id:{}", loginUser.getUserName(), userId);
Map<String, Object> result = resourceService.authorizedUDFFunction(loginUser, userId);
return returnDataList(result);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.common.task.datax;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.process.ResourceInfo;
import org.apache.dolphinscheduler.common.task.AbstractParameters;
/**
* DataX parameter
*/
public class DataxParameters extends AbstractParameters { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | /**
* if custom json config,eg 0, 1
*/
private int customConfig; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | /**
* if customConfig eq 1 ,then json is usable
*/
private String json;
/**
* data source type,eg MYSQL, POSTGRES ...
*/
private String dsType;
/**
* datasource id
*/
private int dataSource;
/**
* data target type,eg MYSQL, POSTGRES ...
*/
private String dtType;
/**
* datatarget id
*/
private int dataTarget;
/**
* sql
*/
private String sql;
/**
* target table
*/
private String targetTable;
/**
* Pre Statements |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | */
private List<String> preStatements;
/**
* Post Statements
*/
private List<String> postStatements;
/**
* speed byte num
*/
private int jobSpeedByte;
/**
* speed record count
*/
private int jobSpeedRecord;
public int getCustomConfig() {
return customConfig;
}
public void setCustomConfig(int customConfig) {
this.customConfig = customConfig;
}
public String getJson() {
return json;
}
public void setJson(String json) {
this.json = json;
}
public String getDsType() {
return dsType;
}
public void setDsType(String dsType) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | this.dsType = dsType;
}
public int getDataSource() {
return dataSource;
}
public void setDataSource(int dataSource) {
this.dataSource = dataSource;
}
public String getDtType() {
return dtType;
}
public void setDtType(String dtType) {
this.dtType = dtType;
}
public int getDataTarget() {
return dataTarget;
}
public void setDataTarget(int dataTarget) {
this.dataTarget = dataTarget;
}
public String getSql() {
return sql;
}
public void setSql(String sql) {
this.sql = sql;
}
public String getTargetTable() {
return targetTable;
}
public void setTargetTable(String targetTable) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | this.targetTable = targetTable;
}
public List<String> getPreStatements() {
return preStatements;
}
public void setPreStatements(List<String> preStatements) {
this.preStatements = preStatements;
}
public List<String> getPostStatements() {
return postStatements;
}
public void setPostStatements(List<String> postStatements) {
this.postStatements = postStatements;
}
public int getJobSpeedByte() {
return jobSpeedByte;
}
public void setJobSpeedByte(int jobSpeedByte) {
this.jobSpeedByte = jobSpeedByte;
}
public int getJobSpeedRecord() {
return jobSpeedRecord;
}
public void setJobSpeedRecord(int jobSpeedRecord) {
this.jobSpeedRecord = jobSpeedRecord;
}
@Override
public boolean checkParameters() {
if (customConfig == Flag.NO.ordinal()) {
return dataSource != 0 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java | && dataTarget != 0
&& StringUtils.isNotEmpty(sql)
&& StringUtils.isNotEmpty(targetTable);
} else {
return StringUtils.isNotEmpty(json);
}
}
@Override
public List<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public String toString() {
return "DataxParameters{" +
"customConfig=" + customConfig +
", json='" + json + '\'' +
", dsType='" + dsType + '\'' +
", dataSource=" + dataSource +
", dtType='" + dtType + '\'' +
", dataTarget=" + dataTarget +
", sql='" + sql + '\'' +
", targetTable='" + targetTable + '\'' +
", preStatements=" + preStatements +
", postStatements=" + postStatements +
", jobSpeedByte=" + jobSpeedByte +
", jobSpeedRecord=" + jobSpeedRecord +
'}';
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.server.worker.task.datax;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
import com.alibaba.druid.sql.ast.expr.SQLPropertyExpr;
import com.alibaba.druid.sql.ast.statement.*;
import com.alibaba.druid.sql.parser.SQLStatementParser;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.io.FileUtils;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.DbType;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.process.Property;
import org.apache.dolphinscheduler.common.task.AbstractParameters;
import org.apache.dolphinscheduler.common.task.datax.DataxParameters;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.common.utils.*;
import org.apache.dolphinscheduler.common.utils.OSUtils; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.dao.datasource.BaseDataSource;
import org.apache.dolphinscheduler.dao.datasource.DataSourceFactory;
import org.apache.dolphinscheduler.server.entity.DataxTaskExecutionContext;
import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.server.utils.DataxUtils;
import org.apache.dolphinscheduler.server.utils.ParamUtils;
import org.apache.dolphinscheduler.server.worker.task.AbstractTask;
import org.apache.dolphinscheduler.server.worker.task.CommandExecuteResult;
import org.apache.dolphinscheduler.server.worker.task.ShellCommandExecutor;
import org.slf4j.Logger;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.sql.*;
import java.util.*;
/**
* DataX task
*/
public class DataxTask extends AbstractTask {
/**
* python process(datax only supports version 2.7 by default)
*/
private static final String DATAX_PYTHON = "python2.7";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | * datax home path
*/
private static final String DATAX_HOME_EVN = "${DATAX_HOME}";
/**
* datax channel count
*/
private static final int DATAX_CHANNEL_COUNT = 1;
/**
* datax parameters
*/
private DataxParameters dataXParameters;
/**
* shell command executor
*/
private ShellCommandExecutor shellCommandExecutor;
/**
* taskExecutionContext
*/
private TaskExecutionContext taskExecutionContext;
/**
* constructor
* @param taskExecutionContext taskExecutionContext
* @param logger logger
*/
public DataxTask(TaskExecutionContext taskExecutionContext, Logger logger) {
super(taskExecutionContext, logger);
this.taskExecutionContext = taskExecutionContext;
this.shellCommandExecutor = new ShellCommandExecutor(this::logHandle,
taskExecutionContext,logger);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | /**
* init DataX config
*/
@Override
public void init() {
logger.info("datax task params {}", taskExecutionContext.getTaskParams());
dataXParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), DataxParameters.class);
if (!dataXParameters.checkParameters()) {
throw new RuntimeException("datax task params is not valid");
}
}
/**
* run DataX process
*
* @throws Exception if error throws Exception
*/
@Override
public void handle() throws Exception {
try {
String threadLoggerInfoName = String.format("TaskLogInfo-%s", taskExecutionContext.getTaskAppId());
Thread.currentThread().setName(threadLoggerInfoName);
Map<String, Property> paramsMap = ParamUtils.convert(ParamUtils.getUserDefParamsMap(taskExecutionContext.getDefinedParams()),
taskExecutionContext.getDefinedParams(),
dataXParameters.getLocalParametersMap(),
CommandType.of(taskExecutionContext.getCmdTypeIfComplement()),
taskExecutionContext.getScheduleTime());
String jsonFilePath = buildDataxJsonFile(paramsMap); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | String shellCommandFilePath = buildShellCommandFile(jsonFilePath, paramsMap);
CommandExecuteResult commandExecuteResult = shellCommandExecutor.run(shellCommandFilePath);
setExitStatusCode(commandExecuteResult.getExitStatusCode());
setAppIds(commandExecuteResult.getAppIds());
setProcessId(commandExecuteResult.getProcessId());
}
catch (Exception e) {
logger.error("datax task failure", e);
setExitStatusCode(Constants.EXIT_CODE_FAILURE);
throw e;
}
}
/**
* cancel DataX process
*
* @param cancelApplication cancelApplication
* @throws Exception if error throws Exception
*/
@Override
public void cancelApplication(boolean cancelApplication)
throws Exception {
shellCommandExecutor.cancelApplication();
}
/**
* build datax configuration file
*
* @return datax json file name
* @throws Exception if error throws Exception
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | private String buildDataxJsonFile(Map<String, Property> paramsMap)
throws Exception {
String fileName = String.format("%s/%s_job.json",
taskExecutionContext.getExecutePath(),
taskExecutionContext.getTaskAppId());
String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
if (dataXParameters.getCustomConfig() == Flag.YES.ordinal()){
json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
}else {
ObjectNode job = JSONUtils.createObjectNode();
job.putArray("content").addAll(buildDataxJobContentJson());
job.set("setting", buildDataxJobSettingJson());
ObjectNode root = JSONUtils.createObjectNode();
root.set("job", job);
root.set("core", buildDataxCoreJson());
json = root.toString();
}
json = ParameterUtils.convertParameterPlaceholders(json, ParamUtils.convert(paramsMap));
logger.debug("datax job json : {}", json);
FileUtils.writeStringToFile(new File(fileName), json, StandardCharsets.UTF_8);
return fileName;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | * build datax job config
*
* @return collection of datax job config JSONObject
* @throws SQLException if error throws SQLException
*/
private List<ObjectNode> buildDataxJobContentJson() {
DataxTaskExecutionContext dataxTaskExecutionContext = taskExecutionContext.getDataxTaskExecutionContext();
BaseDataSource dataSourceCfg = DataSourceFactory.getDatasource(DbType.of(dataxTaskExecutionContext.getSourcetype()),
dataxTaskExecutionContext.getSourceConnectionParams());
BaseDataSource dataTargetCfg = DataSourceFactory.getDatasource(DbType.of(dataxTaskExecutionContext.getTargetType()),
dataxTaskExecutionContext.getTargetConnectionParams());
List<ObjectNode> readerConnArr = new ArrayList<>();
ObjectNode readerConn = JSONUtils.createObjectNode();
ArrayNode sqlArr = readerConn.putArray("querySql");
for (String sql : new String[]{dataXParameters.getSql()}) {
sqlArr.add(sql);
}
ArrayNode urlArr = readerConn.putArray("jdbcUrl");
for (String url : new String[]{dataSourceCfg.getJdbcUrl()}) {
urlArr.add(url);
}
readerConnArr.add(readerConn);
ObjectNode readerParam = JSONUtils.createObjectNode();
readerParam.put("username", dataSourceCfg.getUser());
readerParam.put("password", dataSourceCfg.getPassword());
readerParam.putArray("connection").addAll(readerConnArr);
ObjectNode reader = JSONUtils.createObjectNode();
reader.put("name", DataxUtils.getReaderPluginName(DbType.of(dataxTaskExecutionContext.getSourcetype())));
reader.set("parameter", readerParam);
List<ObjectNode> writerConnArr = new ArrayList<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | ObjectNode writerConn = JSONUtils.createObjectNode();
ArrayNode tableArr = writerConn.putArray("table");
for (String table : new String[]{dataXParameters.getTargetTable()}) {
tableArr.add(table);
}
writerConn.put("jdbcUrl", dataTargetCfg.getJdbcUrl());
writerConnArr.add(writerConn);
ObjectNode writerParam = JSONUtils.createObjectNode();
writerParam.put("username", dataTargetCfg.getUser());
writerParam.put("password", dataTargetCfg.getPassword());
String[] columns = parsingSqlColumnNames(DbType.of(dataxTaskExecutionContext.getSourcetype()),
DbType.of(dataxTaskExecutionContext.getTargetType()),
dataSourceCfg, dataXParameters.getSql());
ArrayNode columnArr = writerParam.putArray("column");
for (String column : columns) {
columnArr.add(column);
}
writerParam.putArray("connection").addAll(writerConnArr);
if (CollectionUtils.isNotEmpty(dataXParameters.getPreStatements())) {
ArrayNode preSqlArr = writerParam.putArray("preSql");
for (String preSql : dataXParameters.getPreStatements()) {
preSqlArr.add(preSql);
}
}
if (CollectionUtils.isNotEmpty(dataXParameters.getPostStatements())) {
ArrayNode postSqlArr = writerParam.putArray("postSql");
for (String postSql : dataXParameters.getPostStatements()) {
postSqlArr.add(postSql);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | ObjectNode writer = JSONUtils.createObjectNode();
writer.put("name", DataxUtils.getWriterPluginName(DbType.of(dataxTaskExecutionContext.getTargetType())));
writer.set("parameter", writerParam);
List<ObjectNode> contentList = new ArrayList<>();
ObjectNode content = JSONUtils.createObjectNode();
content.put("reader", reader.toString());
content.put("writer", writer.toString());
contentList.add(content);
return contentList;
}
/**
* build datax setting config
*
* @return datax setting config JSONObject
*/
private ObjectNode buildDataxJobSettingJson() {
ObjectNode speed = JSONUtils.createObjectNode();
speed.put("channel", DATAX_CHANNEL_COUNT);
if (dataXParameters.getJobSpeedByte() > 0) {
speed.put("byte", dataXParameters.getJobSpeedByte());
}
if (dataXParameters.getJobSpeedRecord() > 0) {
speed.put("record", dataXParameters.getJobSpeedRecord());
}
ObjectNode errorLimit = JSONUtils.createObjectNode();
errorLimit.put("record", 0);
errorLimit.put("percentage", 0);
ObjectNode setting = JSONUtils.createObjectNode();
setting.put("speed", speed.toString());
setting.put("errorLimit", errorLimit.toString()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | return setting;
}
private ObjectNode buildDataxCoreJson() {
ObjectNode speed = JSONUtils.createObjectNode();
speed.put("channel", DATAX_CHANNEL_COUNT);
if (dataXParameters.getJobSpeedByte() > 0) {
speed.put("byte", dataXParameters.getJobSpeedByte());
}
if (dataXParameters.getJobSpeedRecord() > 0) {
speed.put("record", dataXParameters.getJobSpeedRecord());
}
ObjectNode channel = JSONUtils.createObjectNode();
channel.set("speed", speed);
ObjectNode transport = JSONUtils.createObjectNode();
transport.set("channel", channel);
ObjectNode core = JSONUtils.createObjectNode();
core.set("transport", transport);
return core;
}
/**
* create command
*
* @return shell command file name
* @throws Exception if error throws Exception
*/
private String buildShellCommandFile(String jobConfigFilePath, Map<String, Property> paramsMap)
throws Exception {
String fileName = String.format("%s/%s_node.%s",
taskExecutionContext.getExecutePath(), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | taskExecutionContext.getTaskAppId(),
OSUtils.isWindows() ? "bat" : "sh");
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
StringBuilder sbr = new StringBuilder();
sbr.append(DATAX_PYTHON);
sbr.append(" ");
sbr.append(DATAX_HOME_EVN);
sbr.append(" ");
sbr.append(jobConfigFilePath);
String dataxCommand = ParameterUtils.convertParameterPlaceholders(sbr.toString(), ParamUtils.convert(paramsMap));
logger.debug("raw script : {}", dataxCommand);
Set<PosixFilePermission> perms = PosixFilePermissions.fromString(Constants.RWXR_XR_X);
FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);
if (OSUtils.isWindows()) {
Files.createFile(path);
} else {
Files.createFile(path, attr);
}
Files.write(path, dataxCommand.getBytes(), StandardOpenOption.APPEND);
return fileName;
}
/**
* parsing synchronized column names in SQL statements
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | * @param dsType
* the database type of the data source
* @param dtType
* the database type of the data target
* @param dataSourceCfg
* the database connection parameters of the data source
* @param sql
* sql for data synchronization
* @return Keyword converted column names
*/
private String[] parsingSqlColumnNames(DbType dsType, DbType dtType, BaseDataSource dataSourceCfg, String sql) {
String[] columnNames = tryGrammaticalAnalysisSqlColumnNames(dsType, sql);
if (columnNames == null || columnNames.length == 0) {
logger.info("try to execute sql analysis query column name");
columnNames = tryExecuteSqlResolveColumnNames(dataSourceCfg, sql);
}
notNull(columnNames, String.format("parsing sql columns failed : %s", sql));
return DataxUtils.convertKeywordsColumns(dtType, columnNames);
}
/**
* try grammatical parsing column
*
* @param dbType
* database type
* @param sql
* sql for data synchronization
* @return column name array
* @throws RuntimeException if error throws RuntimeException
*/
private String[] tryGrammaticalAnalysisSqlColumnNames(DbType dbType, String sql) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | String[] columnNames;
try {
SQLStatementParser parser = DataxUtils.getSqlStatementParser(dbType, sql);
notNull(parser, String.format("database driver [%s] is not support", dbType.toString()));
SQLStatement sqlStatement = parser.parseStatement();
SQLSelectStatement sqlSelectStatement = (SQLSelectStatement)sqlStatement;
SQLSelect sqlSelect = sqlSelectStatement.getSelect();
List<SQLSelectItem> selectItemList = null;
if (sqlSelect.getQuery() instanceof SQLSelectQueryBlock) {
SQLSelectQueryBlock block = (SQLSelectQueryBlock)sqlSelect.getQuery();
selectItemList = block.getSelectList();
} else if (sqlSelect.getQuery() instanceof SQLUnionQuery) {
SQLUnionQuery unionQuery = (SQLUnionQuery)sqlSelect.getQuery();
SQLSelectQueryBlock block = (SQLSelectQueryBlock)unionQuery.getRight();
selectItemList = block.getSelectList();
}
notNull(selectItemList,
String.format("select query type [%s] is not support", sqlSelect.getQuery().toString()));
columnNames = new String[selectItemList.size()];
for (int i = 0; i < selectItemList.size(); i++ ) {
SQLSelectItem item = selectItemList.get(i);
String columnName = null;
if (item.getAlias() != null) {
columnName = item.getAlias();
} else if (item.getExpr() != null) {
if (item.getExpr() instanceof SQLPropertyExpr) {
SQLPropertyExpr expr = (SQLPropertyExpr)item.getExpr();
columnName = expr.getName();
} else if (item.getExpr() instanceof SQLIdentifierExpr) {
SQLIdentifierExpr expr = (SQLIdentifierExpr)item.getExpr(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 3,985 | [Feature][Datax] Datax supports setting up running memory |
DataX default memory is 1g, when the amount of data is large, memory will not be enough
So you need to support setting runtime JVM memory

| https://github.com/apache/dolphinscheduler/issues/3985 | https://github.com/apache/dolphinscheduler/pull/3986 | 89f1e93bcf936b527856f658e33fe38ead5ec8b9 | fe3026627fc2d38da08ae396724cc61bc922374a | "2020-10-24T07:25:07Z" | java | "2020-11-16T02:55:20Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java | columnName = expr.getName();
}
} else {
throw new RuntimeException(
String.format("grammatical analysis sql column [ %s ] failed", item.toString()));
}
if (columnName == null) {
throw new RuntimeException(
String.format("grammatical analysis sql column [ %s ] failed", item.toString()));
}
columnNames[i] = columnName;
}
}
catch (Exception e) {
logger.warn(e.getMessage(), e);
return null;
}
return columnNames;
}
/**
* try to execute sql to resolve column names
*
* @param baseDataSource
* the database connection parameters
* @param sql
* sql for data synchronization
* @return column name array
*/
public String[] tryExecuteSqlResolveColumnNames(BaseDataSource baseDataSource, String sql) {
String[] columnNames; |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.