Skip to content

Stop copying embedded Mongo step executions - #5694

Open
beyondwin wants to merge 1 commit into
spring-projects:mainfrom
beyondwin:GH-5693
Open

beyondwin wants to merge 1 commit into
spring-projects:mainfrom
beyondwin:GH-5693

Conversation

@beyondwin

Copy link
Copy Markdown
Contributor

Reloading a job execution from MongoDB returns each step saved on the job document twice: once from the embedded array and once from the step-execution collection. A completed two-step job reloads with step1 and step2 twice each. The embedded copy can be stale, still STARTING with read count 0 after the collection says COMPLETED with read count 5. Saving a reloaded execution writes both copies back, so four reload-and-save cycles of a two-step job return 4, 6, 8, and 10 steps.

JobExecutionConverter no longer copies the embedded array. The explorer still attaches the collection, as it does for JDBC, and saving still writes the array. 6.0.6 and 6.1.0 are affected. 5.2.6 is not, because addStepExecutions replaced equal steps before 90d8959.

Resolves #5693

Reloading a job execution from MongoDB returns each step saved on the
job document twice: once from the embedded array and once from the
step-execution collection. The embedded copy can be stale, and saving
the reloaded execution writes both copies back, so the array grows by
the number of steps on each reload and save.

Before 90d8959, JobExecution.addStepExecutions replaced equal step
executions. It now appends.

JobExecutionConverter.toJobExecution no longer copies the array. The
explorer still attaches the collection, as it does for JDBC, and saving
a job execution still writes the array.

Resolves spring-projects#5693

Signed-off-by: WooSeung Kim <wooseung.dev@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step executions are listed twice when a job execution is reloaded from MongoDB

1 participant