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 2022/09/14 17:19:57 UTC

[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #11942: [Bug] [dolphinscheduler-service] NPE was raised when i open Workflow Definition UI after saving one Workflow Instance without selecting syncDefine

github-actions[bot] commented on issue #11942:
URL: https://github.com/apache/dolphinscheduler/issues/11942#issuecomment-1247076771

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   As the issue title said,steps as list:
   1. Define a Workflow and run it , then i got a Workflow Instance
   ![图片](https://user-images.githubusercontent.com/49931055/190185414-1e08269f-0196-46f7-937b-fa9a23d46844.png)
   ![图片](https://user-images.githubusercontent.com/49931055/190185644-e3236ae1-50e3-4bb9-9504-a4cf216b507e.png)
   
   2. Edit the Workflow Instance then saving it without selecting 'update definition' check-box . 
   ![图片](https://user-images.githubusercontent.com/49931055/190186198-a4ecdc2f-f23b-40f3-a363-3fa0b9b1a020.png)
   
   3. Return to the Workflow Definition UI , i got a error 
   ![图片](https://user-images.githubusercontent.com/49931055/190186425-94b87f35-2979-4d00-887f-a420d56d3bc6.png)
   and i found an NPE in the backend logs
   ![图片](https://user-images.githubusercontent.com/49931055/190187602-2b385326-5453-4e0d-8c13-2014b718215b.png)
   The direct cause is **THE VAR `processDefinitionLog` IS NULL**
   ![图片](https://user-images.githubusercontent.com/49931055/190188133-f0a67785-7e4a-4b56-adb7-701917454b5a.png)
   
   4. i check records in the meta-database(mysql style) and find that records accidentally lost in table `t_ds_process_definition_log` 
   There should be two records, their `version` column values ​​are 1 and 2 respectively
   (直接原因是t_ds_process_definition_log表丢失了一条version列值为1的记录)
   ![图片](https://user-images.githubusercontent.com/49931055/190189561-d19c660e-264f-46a4-8077-366107406d0b.png)
   
   
   
   
   ### What you expected to happen
   
   No exception occurred
   
   ### How to reproduce
   
   The steps are listed in the paragraph **What happened** above
   
   ### Anything else
   
   I analysis the codes and i think the root is in method `org.apache.dolphinscheduler.service.process.ProcessServiceImpl#saveProcessDefine`: 
   it query the `log obj` which according to the `ID` of the `definition obj` , then updating the `log obj` to set a new `version` .
   The `t_ds_process_definition_log` table should keeps all records of definition's changes and the record should not be overwritten or updated, which may be against the design 
   (根本原因是更新工作流实例时,根据工作流定义的ID查找了 `LOG 对象` 并修改了 `version值` , Log表应该保留所有定义变更的历史记录,不应该把version=1的记录更新掉。况且用定义对象的ID去查询更新LOG对象就不对。)
   ![图片](https://user-images.githubusercontent.com/49931055/190192100-3af59cb2-9c57-4d8a-9d19-41ee52c10649.png)
   
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)


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