control-service: fix control service post deployment test #2790
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
We observed the following post-deployment test failure: https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/5192553226.
This change is the culprit #2714
It’s the first pipeline that started having this issue https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/5210024385
The previous change for the control service that triggered the same tests passed fine. There weren’t any changes to heartbeat or control-cli in between, as far as I can tell. You can see from the logs that the schedule is written to the data job table for the previous control service change that triggered the same tests.
https://gitlab.com/vmware-analytics/versatile-data-kit/-/pipelines/1020826286
https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/5192553226
The control-cli does a PUT request after creating the data job. This updates the config, which includes the schedule. For some reason, the config doesn’t get updated. The change touches some of the update code, namely, it passes the new DesiredJobDeployment entity into the JobImageBuilder, which is used in the JobService update method, which gets called when we do a PUT request to update the job.
What
Removed the unnecessary @transactional annotation from the DesiredJobDeploymentRepository methods which prevent from committing the transaction started in JobsService.updateJob().
Testing done
Manually created data job through the DataJob API and then updated it through the DataJob API.
create: localhost:8092/data-jobs/for-team/taurus/jobs
update: localhost:8092/data-jobs/for-team/taurus/jobs/miroslavi-test6
Signed-off-by: Miroslav Ivanov miroslavi@vmware.com