Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: DesiredCanaries can be set on every pass safely #8456

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented Jul 17, 2020

The reconcile loop sets DeploymentState.DesiredCanaries only on the first pass through the loop and if the job is not paused/pending. In MRD, deployments will make one pass though the loop while "pending", and were not ever getting DesiredCanaries set. We can't set it in the initial DeploymentState constructor because the first pass through setting up canaries expects it's not there yet. However, this value is static for a given version of a job because it's coming from the update stanza, so it's safe to re-assign the value on subsequent passes. This is fa63c8f

Includes a minor refactor to make it clear where we're accessing dstate. The field name Deployment.TaskGroups contains a map of DeploymentState, which makes it a little harder to follow state updates when combined with inconsistent naming conventions, particularly when we also have the state store or actual TaskGroups in scope. Change all uses to dstate so as not to be confused with actual TaskGroups. This is a separate commit 7552fff.

The field name `Deployment.TaskGroups` contains a map of `DeploymentState`,
which makes it a little harder to follow state updates when combined with
inconsistent naming conventions, particularly when we also have the state
store or actual `TaskGroup`s in scope. This changeset changes all uses to
`dstate` so as not to be confused with actual TaskGroups.
The reconcile loop sets `DeploymentState.DesiredCanaries` only on the first
pass through the loop and if the job is not paused/pending. In MRD,
deployments will make one pass though the loop while "pending", and were not
ever getting `DesiredCanaries` set. We can't set it in the initial
`DeploymentState` constructor because the first pass through setting up
canaries expects it's not there yet. However, this value is static for a given
version of a job because it's coming from the update stanza, so it's safe to
re-assign the value on subsequent passes.
@tgross tgross marked this pull request as ready for review July 20, 2020 15:11
@tgross tgross requested review from notnoop and cgbaker July 20, 2020 15:11
@tgross tgross added this to the 0.12.1 milestone Jul 20, 2020
@tgross tgross merged commit 6ed0f4e into master Jul 20, 2020
@tgross tgross deleted the b-mrd-canaries branch July 20, 2020 15:25
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants