You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/11/14 04:25:28 UTC

[GitHub] [dolphinscheduler] JinyLeeChina commented on a change in pull request #6784: [Fix-#6783] fix: #6783 switchVersion error (#6783)

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



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskDefinitionServiceImpl.java
##########
@@ -288,10 +288,11 @@
             putMsg(result, Status.TASK_DEFINE_NOT_EXIST, taskCode);
             return result;
         }
-        TaskDefinitionLog taskDefinitionLog = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
-        taskDefinitionLog.setUserId(loginUser.getId());
-        taskDefinitionLog.setUpdateTime(new Date());
-        int switchVersion = taskDefinitionMapper.updateById(taskDefinitionLog);
+        TaskDefinitionLog taskDefinitionUpdate = taskDefinitionLogMapper.queryByDefinitionCodeAndVersion(taskCode, version);
+        taskDefinitionUpdate.setUserId(loginUser.getId());
+        taskDefinitionUpdate.setUpdateTime(new Date());
+        taskDefinitionUpdate.setId(taskDefinition.getId());

Review comment:
       > I do not think directly set `task definitions log` id here. I think both` task definition` and `task definition log` id could be auto increase. Am I wrong @JinyLeeChina
   
   Yes, you're right. In `t_ds_task_definition` and `t_ds_task_definition_log`, `Id` has no business meaning, just as a table to auto-increase the primary key. During `switchTaskDefinitionVersion` , the `update_time` and `id` of the main table data and log table will be different, and others will be the same




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org