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

Handle Scaling Policies in Job Plan endpoint #8567

Merged
merged 4 commits into from
Jul 30, 2020
Merged

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Jul 30, 2020

Fixes #8544

This PR fixes a bug where using nomad job plan ... always report no change if the submitted job contain scaling.

The issue has three contributing factors:

  1. The plan endpoint doesn't populate the required scaling policy ID; unlike the job register endpoint
  2. The plan endpoint suppresses errors on job insertion - the job insertion fails here, because the scaling policy is missing the required ID
  3. The scheduler reports no update necessary when the relevant job isn't in store (because the insertion failed)

This PR fixes the first two factors. Changing the scheduler to be more strict might make sense, but may violate some idempotency invariant or make the scheduler more brittle.

I added the test early, so reviewer can see the failing TestJobEndpoint_Plan_Scaling test in https://app.circleci.com/pipelines/github/hashicorp/nomad/10845/workflows/f535e389-633b-46db-b304-353c79c3894e/jobs/87394 but is green afterwards.

@notnoop notnoop requested review from cgbaker and jrasell July 30, 2020 15:58
@notnoop notnoop self-assigned this Jul 30, 2020
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for jumping on this @notnoop! Tested locally and can confirm it fixes the linked issue.

[ci skip]
@notnoop notnoop merged commit e57c252 into master Jul 30, 2020
@notnoop notnoop deleted the b-plan-scaling-jobs branch July 30, 2020 16:27
@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 27, 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.

resource stanza completed ignored during first plan
2 participants