liqingwang opened a new pull request, #9994: URL: https://github.com/apache/dolphinscheduler/pull/9994
<!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.--> ## Purpose of the pull request This pull request fix db-init-job failed when to deploy on k8s by helm. When you helm install dolphinscheduler on k8s and occured this bug. The detail can see #9963. And the reason why is there are three class SpringBootApplication ```CreateDolphinScheduler InitDolphinScheduler and UpgradeDolphinScheduler``` in tools-modules. And they are in the same pkg. When you run any class SpringBootApplication will auto-scan all their runner classes by ```@Component```. The SQL file will running twice. And the table t_ds_process_instance can't dropped because of foreign_key. ``` cannot drop table t_ds_process_instance because other objects depend on it Detail: constraint foreign_key_instance_id on table t_ds_task_instance depends on table t_ds_process_instance ``` So there is a problem. The solution is to configure to only scan itself and run only runner itself. <!--(For example: This pull request adds checkstyle plugin).--> ## Brief change log * Change dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/CreateDolphinScheduler.java * Change dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/InitDolphinScheduler.java * Change dolphinscheduler-tools/src/main/java/org/apache/dolphinscheduler/tools/datasource/UpgradeDolphinScheduler.java <!--*(for example:)* - *Add maven-checkstyle-plugin to root pom.xml* --> ## Verify this pull request * I have test local close #9963 -- 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]
