[Bug] [API&MASTER] 3.2.0 The restart of MySQL 5.7 can cause an Auto Increment ID reset, potentially resulting in the inability to execute command.
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
When calling thestartProcessInstance API (/executors/start-process-instance), no workflow instance is generated. Upon checking the dolphinscheduler-master log, I found the following Exception:
I found that https://github.com/apache/dolphinscheduler/pull/13184 added the method queryByTypeAndJobId and the table t_ds_trigger_relation. In the t_ds_trigger_relation table, the job_id corresponds to the id in the t_ds_command table.
When MySQL 5.7 is restarted, it will reset the auto-increment ID of thet_ds_command table. This will lead to duplicatedjob_id entries in thet_ds_trigger_relation table. Subsequently, when querying using thequeryByTypeAndJobId method, an error message may occur: 'Expected one result (or null) to be returned by selectOne(), but found: 2'.
The job_id in the t_ds_trigger_relation table has already exceeded 7000.
the auto-increment ID of the
t_ds_command table has become 418.
Similarly,t_ds_error_command cannot be inserted.
What you expected to happen
I think I can add a 'code' field to the 't_ds_command' table, and then establish associations with other tables using this 'code' field.is there any other better way?
How to reproduce
restart mysql.exec process.
Anything else
No response
Version
3.2.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
I think add a code field would be better
I think add a code field would be better
I noticed that the job_id field in the t_ds_trigger_relation table also holds the id field from the t_ds_process_instance table. If I add a code field to the t_ds_command table, should I also add a code field to the t_ds_process_instance table for association? This change may have significant implications, so I believe it warrants further discussion.
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 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.