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



##########
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:
       > @JinyLeeChina plz check this. i am not sure its as same as the issue 
#8043.
   > 
   > the logic maybe like this according to @JinyLeeChina .
   > 
   > any part of the workflow changed would lead to the workflow's version 
change. so when you changed one taskDefinition, the taskDefinition has two 
version now, but the workflow doesn`t. When ui query this workflow it returns 
two taskDefinition with same code but different version and this cause the 
duplicate error
   
   Yes, I also think this is the same problem as #8043. It has been 
fundamentally solved in version 203. There are design changes from 202 to 203. 
From 2.0.0 to 2.0.2, the version is designed with task as the core, and the 
version is designed with workflow as the core after 2.0.3. Therefore, the PR 
submitted in #8043 is for this design change. At the same time, the problem of 
repeated key is also fundamentally solved, not just the bug




-- 
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