-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
This fixes incorrect parent job summaries by recomputing them in the ReconcileJobSummaries method in the state store
also added unit tests
dev/cluster/client1.hcl
Outdated
@@ -10,7 +10,9 @@ name = "client1" | |||
# Enable the client | |||
client { | |||
enabled = true | |||
|
|||
options = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
nomad/state/state_store.go
Outdated
|
||
// 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use txn.First?
nomad/state/state_store.go
Outdated
} | ||
|
||
rawSummary := summaryIter.Next() | ||
if rawSummary != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if rawSummary == nil { continue}
Great work @preetapan! |
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. |
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 theSummary
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