-
Notifications
You must be signed in to change notification settings - Fork 40.3k
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
Stably sort controllerrevisions #66882
Stably sort controllerrevisions #66882
Conversation
/assign @smarterclayton |
This is somewhat related to this bug: #63282 |
/ok-to-test |
/retest |
/sig apps |
Verify is failing on a gofmt check, can you please run hack/update-gofmt.sh? |
one more format issue:
|
/retest |
pull-kubernetes-verify — Job succeeded. |
Those do look like flakes, I've also mentioned this PR in #sig-apps on slack seeing if I can get someone appropriate to take a look. 👍 |
sort.Sort(byRevision(revisions)) | ||
// Stably sort first by name to break revision number ties by name | ||
sort.Stable(byName(revisions)) | ||
sort.Stable(byRevision(revisions)) |
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.
You don't need to sort it twice. In the Less
function of byRevision
, use a tie-breaker there when two revisions are equal. I'd prefer using something like CreationTimestamp
as a tie-breaker.
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 use Name
as another tie-breaker if both Revision
and CreationTimestamp
are equal.
gentle poke @ryanmcnamara :-) #66882 (comment) |
/assign @janetkuo |
Thanks for keeping after this! Poke @janetkuo :-) |
@janetkuo any update? |
Ping @BenTheElder @janetkuo |
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.
/lgtm
@janetkuo done! |
/retest |
We have a merge robot that ~ merges approved + lgtm'd PRs once they are passing tests against the target branch. |
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.
/lgtm
sorry for the huge delay!
ping @janetkuo @BenTheElder |
/test pull-kubernetes-godeps |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: janetkuo, ryanmcnamara 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 |
/test pull-kubernetes-godeps |
ah, we've had issues with hg + bitbucket, there's a fix being worked on. I don't think we have a tracking issue yet. |
/retest |
/test pull-kubernetes-godeps |
/retest Review the full test history for this PR. Silence the bot with an |
6 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/test pull-kubernetes-godeps |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
Sorry that took so long @ryanmcnamara, thanks again for the PR! |
Fixes #61998
There are times when multiple "equal" controllerrevisions are created with
the same revision number. When this happens and this is the case for the
largest revision number, the statefulset controller will periodically
select one of the maximal controllerrevisions to be the target of the
underlying statefulset. The selection happens here: /~https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/statefulset/stateful_set_control.go#L212.
Prior to this change this selection was random as the sort was not
stable, which caused the pods of a stable set to continually roll.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: