Project: springxd
Issue XD-1865: Increase performance of query to determine Job restartability
In BatchJobExecutionsController's list all job executions, for each given job execution, it needs to be evaluated against all the job executions of a given job instance to see if the job execution is restarted. The rule is: for a given JobInstance, there could be only one job execution that can be in "COMPLETED" state. If the job itself is restartable and if any of the job executions for this job instance are "FAILED" or "STOPPED" then, that job execution can be restarted (based on the client request). Hence, if the job execution is complete, then it will set the restartable flag to false for all the job executions on a given job instance.
Story points: 3