Open ilopezv opened 2 years ago
Also created issue https://github.com/spring-cloud/spring-cloud-task/issues/853 for task.
Sounds like the right approach. We will update the schema in scdf in the 2.10 release time frame. This is not dependent upon the upcoming releases of spring batch/task - scdf 'owns' these tables.
this fix is finally included on 2.10.1 and upwards?
Description: SCDF schema created following the one present at https://github.com/spring-cloud/spring-cloud-dataflow/blob/main/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/db/migration/oracle/V1__Initial_Setup.java define a sequence
TASK_SEQ
created by the snippet below present at V1__Initial_Setup.java that didn´t has order definedthese sequence is created with no order that is the default value in Oracle, because of that tasks with multiple executions are no following sequence order over time in some situations and it is materialized in JobInstanceAlreadyCompleteException during the job instance.
Attached below you will find the image where you can see executions with one hour of diference being instanciated with a sequence number less than the last one (execution-id 31225 < 31245)
The problem was solved indicating the ORDER modificator in the sequence
Release versions: SCDF 2.3.1.RELEASE but it is present in actual main branch
Custom apps: N/A.
Steps to reproduce: Create a task. Execute as many executions as you want using the RunIdJobIncrementer at the batch job implementation
Screenshots:![execution-id-error](https://user-images.githubusercontent.com/14928504/175020020-4de28b19-b295-4a91-954e-c849b17d4e53.png)
Additional context: I think the bug is present in both spring-cloud-server and spring-cloud-task projects https://github.com/spring-cloud/spring-cloud-task/blob/main/spring-cloud-task-core/src/main/resources/org/springframework/cloud/task/schema-oracle.sql#L29, but I prefer to solve that on spring-cloud-dataflow prior to open it on spring-cloud-task.
On the other hand, what is the reason for disabling CACHE in TASK_SEQ sequence? it seems to go against OracleDB recomendations Oracle Sequences
Oracle recommends using the CACHE setting to enhance performance if you are using sequences in a Real Application Clusters environment.