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

Reconcile child summaries correctly #5205

Merged
merged 7 commits into from
Jan 19, 2019
Merged

Reconcile child summaries correctly #5205

merged 7 commits into from
Jan 19, 2019

Conversation

preetapan
Copy link
Contributor

This PR fixes a long standing bug that affects parameterized/periodic jobs when reconciling job summaries.

The Children field was being overridden to empty, and the Summary field values were incorrect, prior to this fix. After this fix, a leader election or using the reconcile summaries endpoint should fix the summaries to be accurate.

Fixes #3886

Preetha Appan added 4 commits January 17, 2019 10:18
This fixes incorrect parent job summaries by recomputing them in the
ReconcileJobSummaries method in the state store
@preetapan preetapan requested a review from dadgar January 17, 2019 20:35
@@ -10,7 +10,9 @@ name = "client1"
# Enable the client
client {
enabled = true

options = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove


// The following block of code fixes incorrect child summaries due to a bug
// See https://github.com/hashicorp/nomad/issues/3886 for details
summaryIter, err := txn.Get("job_summary", "id", job.Namespace, job.ID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Use txn.First?

}

rawSummary := summaryIter.Next()
if rawSummary != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

if rawSummary == nil { continue}

@hashicorp-cla
Copy link

hashicorp-cla commented Jan 18, 2019

CLA assistant check
All committers have signed the CLA.

@preetapan preetapan merged commit dbb2e26 into master Jan 19, 2019
@preetapan preetapan deleted the b-queuedallocs-bugfix branch January 19, 2019 00:15
@burdandrei
Copy link
Contributor

burdandrei commented Jan 20, 2019

Great work @preetapan!
looks like 0.9 will be the release with all the fixes!

@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 Feb 11, 2023
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.

Periodic and parameterized Batch jobs with no children are shown as queued in summary when server is reelected
4 participants