SbloodyS commented on a change in pull request #8309:
URL: https://github.com/apache/dolphinscheduler/pull/8309#discussion_r804342731



##########
File path: 
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
##########
@@ -2416,7 +2416,13 @@ public int saveTaskRelation(User operator, long 
projectCode, long processDefinit
         Map<Long, TaskDefinitionLog> taskDefinitionLogMap = null;
         if (CollectionUtils.isNotEmpty(taskDefinitionLogs)) {
             taskDefinitionLogMap = taskDefinitionLogs.stream()
-                    .collect(Collectors.toMap(TaskDefinition::getCode, 
taskDefinitionLog -> taskDefinitionLog));
+                    .collect(
+                        Collectors.toMap(
+                            TaskDefinition::getCode,
+                            taskDefinitionLog -> taskDefinitionLog,
+                            (entityOld , entityNew) -> entityOld

Review comment:
       ![](https://vip2.loli.io/2022/02/11/R7bASNIcOM3VepJ.png)
   
   After several days of careful investigation, I probably found the cause of 
this situation.
   
   Steps to reproduce:
   1.Create a workflow with dependent nodes in 1.3.9, and the dependent nodes 
contain more than 1 dependency.
   2.Create a new process definition by using copy workflow and then modify 
copyed workflow content randomly.
   3.Upgrade version from 1.3.9 to 2.0.3.
   4.Update process instance/definition.
   
   The reason is that after using the copy workflow, the dependency will be 
copied, resulting in multiple identical pre tasks. At this time, there will be 
multiple workflow definitions and workflow relationships in the request sent by 
saving the workflow definition.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to