-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add Controller Revision (Implementation of KEP #238) #277
Add Controller Revision (Implementation of KEP #238) #277
Conversation
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.
First round, I didn't look at tests.
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.
more comments on simplifying the history pkg
Addressed majority of comments, still need to add more tests and rebase to be ready to merge |
Great, i will look later today, please ensure we have sufficient integration test coverage |
…ented TruncateHistory and fixed getPatch
e674b72
to
8d3da19
Compare
@@ -387,6 +410,9 @@ func (r *LeaderWorkerSetReconciler) updateConditions(ctx context.Context, lws *l | |||
conditions = append(conditions, makeCondition(leaderworkerset.LeaderWorkerSetUpgradeInProgress)) | |||
} else if updatedAndReadyCount == int(*lws.Spec.Replicas) { | |||
conditions = append(conditions, makeCondition(leaderworkerset.LeaderWorkerSetAvailable)) | |||
if err := revisionutils.TruncateHistory(ctx, r.Client, lws, templateHash); err != 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.
as a follow up, we can store the current and updated revisions for debugging purposes. The current one can be set here, while the updated one can be set in the if block above.
Finished addressing comments. I agree, makes sense to change |
Addressed comments. Flakiness of tests is much higher now that everything uses FYI I do want to add integration tests before merging which is why I had the WIP tag in the title |
test/e2e/e2e_test.go
Outdated
return fmt.Errorf("StatefulSet did not have the expected container name") | ||
} | ||
return nil | ||
}, timeout, interval).Should(gomega.Succeed()) |
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.
This test will be flaky, how do you guarantee that the update isn't faster than your check here?
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.
There is no guarantee, that is just a risk that is taken when checking the state mid update. Similar issue in other e2e tests. All I can do is have as many replicas as possible so that the update takes long to reach the "-0" leader sts. Hasn't failed after many runs so far though.
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.
We can't have tests that don't offer guarantees, those will flake, which means when they fail, we don't know if they fail because of a bug or the race condition. The test you are trying to do here should be done via an integration test where we control update progress.
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.
Right, but other update tests also don't offer guarantees. For example this one https://github.com/kubernetes-sigs/lws/blob/main/test/e2e/e2e_test.go#L181, what guarantees that the update isn't done before this check is performed? I guess I'm just confused as to why we can do it there but not here, both are checking the state mid update.
@Edwinhr716: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
test/e2e/e2e_test.go
Outdated
|
||
gomega.Eventually(func() (bool, error) { | ||
return initialLeaderPod.UID == midUpdateLeaderPod.UID, nil | ||
}, timeout, interval).Should(gomega.Equal(false)) |
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.
why is this in an eventually clause? nothing is changing inside it
/lgtm Will use #294 to track integration tests |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, Edwinhr716 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it
This PR adds controller revision. This allows the controller to store previous iterations of the LWS object, which then makes it possible to select the correct pod template spec to use if a replica is restarted during rolling update.
Which issue(s) this PR fixes
Fixes #238
Fixes #239
Fixes #240
Fixes #281
Fixes #291
Special notes for your reviewer
Does this PR introduce a user-facing change?