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/11/11 12:21:48 UTC

[GitHub] [dolphinscheduler] lsy1072915121 opened a new issue, #12872: [Bug] [VCS] 工作流无修改情况下保存,仍会记录版本信息

lsy1072915121 opened a new issue, #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872

   ### 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
   
   工作流版本信息记录中,会把没有内容变化的工作流保存操作,也记录一条版本信息。在源码中发现,开发者已经有意把没有修改的保存操作过滤掉,但实际上并不起效果。
   
   ### What you expected to happen
   
   正常来说,工作流在没有修改的情况下保存,应该是不需要记录版本信息的。
   
   ### How to reproduce
   
   <img width="1219" alt="iShot2022-11-11 19 37 19" src="https://user-images.githubusercontent.com/20608690/201332707-b075cf15-799a-4b67-bd64-5c61e578c68c.png">
   创建一个工作流,会有一个v1版本记录。
   
   
   <img width="1386" alt="iShot2022-11-11 19 39 53" src="https://user-images.githubusercontent.com/20608690/201338847-78f74a97-3067-4237-8974-1361f5e4d9de.png">
   再次打开这个工作流,在工作流没有任何修改的情况下,点击保存
   
   <img width="1244" alt="iShot2022-11-11 19 41 10" src="https://user-images.githubusercontent.com/20608690/201338976-ee27590d-846c-4373-9bf7-6d264b15471d.png">
   仍会有一条版本信息被记录下来。
   
   
   
   
   ### Anything else
   
   # 研究源码后找到了原因,提供参考
   
   <img width="1199" alt="iShot2022-11-11 19 50 42" src="https://user-images.githubusercontent.com/20608690/201334747-01d58d22-7692-4da8-848b-ef0032aadc31.png">
   这部分代码中可以看出,本意是有过滤无修改的保存操作的。
   <img width="1184" alt="iShot2022-11-11 19 53 58" src="https://user-images.githubusercontent.com/20608690/201335227-a2de2749-af57-4dd2-a04e-319b39524331.png">
   但是在这一步中,即使无操作保存,这里的isChange也会是true,原因是removeAll出了问题。
   
   <img width="1372" alt="iShot2022-11-11 19 57 13" src="https://user-images.githubusercontent.com/20608690/201336064-9910432c-0caa-41a4-a62b-0f202aa8d5d9.png">
   可以看到,ProcessTaskRelationLog覆写hashCode方法是调用了ProcessTaskRelation的hashCode,而hashCode中是对name, processDefinitionVersion, projectCode, processDefinitionCode, preTaskCode, preTaskVersion, postTaskCode, postTaskVersion 等参数取hash值。
   <img width="1237" alt="iShot2022-11-11 20 04 07" src="https://user-images.githubusercontent.com/20608690/201336830-bd537993-395e-4c21-8731-b7d4f5d675d5.png">
   
   实际上,前端传了的taskDefinitionJson中是不包含 processDefinitionVersion, projectCode,processDefinitionCode这是三个参数,removeAll出错,一直被误认为isChange,最终导致无修改操作也会有版本记录。
   
   
   # 解决办法
   前端把那三个参数带上,就可以了,下次无修改保存后就不会记录版本信息了。
   
   ### Version
   
   2.0.x
   
   ### 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.apache.org

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


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872#issuecomment-1352394685

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


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


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872#issuecomment-1311632887

   ### 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
   
   In the workflow version information record, the workflow save operation with no content change will be recorded, and a version information will also be recorded. It is found in the source code that the developer has intentionally filtered out the unmodified save operation, but it does not actually work.
   
   ### What you expected to happen
   
   Normally, workflows are saved without modification, and there should be no need to record version information.
   
   ### How to reproduce
   
   <img width="1219" alt="iShot2022-11-11 19 37 19" src="https://user-images.githubusercontent.com/20608690/201332707-b075cf15-799a-4b67-bd64-5c61e578c68c.png" >
   Create a workflow and there will be a v1 version record.
   
   
   <img width="1386" alt="iShot2022-11-11 19 39 53" src="https://user-images.githubusercontent.com/20608690/201338847-78f74a97-3067-4237-8974-1361f5e4d9de.png" >
   Open the workflow again, and click Save without any modifications to the workflow
   
   <img width="1244" alt="iShot2022-11-11 19 41 10" src="https://user-images.githubusercontent.com/20608690/201338976-ee27590d-846c-4373-9bf7-6d264b15471d.png" >
   There will still be a version message logged.
   
   
   
   
   ### Anything else
   
   # After researching the source code, I found the reason and provided a reference
   
   <img width="1199" alt="iShot2022-11-11 19 50 42" src="https://user-images.githubusercontent.com/20608690/201334747-01d58d22-7692-4da8-848b-ef0032aadc31.png" >
   It can be seen from this part of the code that the original intention is to filter the save operation without modification.
   <img width="1184" alt="iShot2022-11-11 19 53 58" src="https://user-images.githubusercontent.com/20608690/201335227-a2de2749-af57-4dd2-a04e-319b39524331.png" >
   But in this step, even if there is no operation to save, the isChange here will be true, because there is a problem with removeAll.
   
   <img width="1372" alt="iShot2022-11-11 19 57 13" src="https://user-images.githubusercontent.com/20608690/201336064-9910432c-0caa-41a4-a62b-0f202aa8d5d9.png" >
   It can be seen that ProcessTaskRelationLog overwrites the hashCode method by calling the hashCode of ProcessTaskRelation, and the hashCode takes the hash value for the parameters such as name, processDefinitionVersion, projectCode, processDefinitionCode, preTaskCode, preTaskVersion, postTaskCode, postTaskVersion.
   <img width="1237" alt="iShot2022-11-11 20 04 07" src="https://user-images.githubusercontent.com/20608690/201336830-bd537993-395e-4c21-8731-b7d4f5d675d5.png" >
   
   In fact, the taskDefinitionJson transmitted by the front-end does not contain processDefinitionVersion, projectCode, processDefinitionCode. These are three parameters. The removeAll error has been mistaken for isChange, and eventually there will be version records for no modification operations.
   
   
   # Solution
   The front end can bring those three parameters, and it will be fine. The version information will not be recorded after the next save without modification.
   
   ### Version
   
   2.0.x
   
   ### 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


[GitHub] [dolphinscheduler] github-actions[bot] closed issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded
URL: https://github.com/apache/dolphinscheduler/issues/12872


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


[GitHub] [dolphinscheduler] pandong2011 commented on issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
pandong2011 commented on issue #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872#issuecomment-1312374499

   Regarding workflow definition and workflow instance, task definition and task instance, the related api, especially the modified api, there are a lot of bugs, and the modification logic and code are also very confusing, which makes people find bugs and have no desire to submit pr


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


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872#issuecomment-1311633225

   Thank you for your feedback, we have received your issue, Please wait patiently for a reply.
   * In order for us to understand your request as soon as possible, please provide detailed information、version or pictures.
   * If you haven't received a reply for a long time, you can [join our slack](https://s.apache.org/dolphinscheduler-slack) and send your question to channel `#troubleshooting`


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


[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #12872: [Bug] [VCS] If the workflow is saved without modification, the version information will still be recorded

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #12872:
URL: https://github.com/apache/dolphinscheduler/issues/12872#issuecomment-1363463315

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


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