-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Added field CollisionCount to StatefulSetStatus #49983
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
Hi @liyinan926. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. 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/test-infra repository. I understand the commands that are listed here. |
CLA signed. |
pkg/apis/apps/types.go
Outdated
@@ -187,6 +187,12 @@ type StatefulSetStatus struct { | |||
// updateRevision, if not empty, indicates the version of the StatefulSet used to generate Pods in the sequence | |||
// [replicas-updatedReplicas,replicas) | |||
UpdateRevision string | |||
|
|||
// Count of hash collisions for the StatefulSet. The StatefulSet controller |
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.
Please keep the code style, like "collisionCount is the count of hash collisions for the StatefulSet ..."
Please also fix the code style in other places for this field.
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.
Done.
/ok-to-test |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
/retest |
/assign @thockin |
/assign thockin |
@thockin Need your approval. PTAL. Thanks! |
// uses this field as a collision avoidance mechanism when it needs to create the name for the | ||
// newest ControllerRevision. | ||
// +optional | ||
CollisionCount *int64 |
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 int64 and not int32? Do you expect more than 2 billion collisions? JSON is known to have trouble carrying int64 values, which can make automated API fuzzing difficult.
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 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.
Consistent with wrong is still wrong. I'd like to hear a reason this can't be int32, and the others fixed.
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.
Will update to use int32 and have a follow up PR to change it to int32 in other controllers.
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.
JSON is known to have trouble carrying int64 values, which can make automated API fuzzing difficult.
This is not an issue that users have actually reported having, and fuzzing currently works for these API objects. If you configure your decoder appropriately or use structs, or classes depending on the language, to decode, disambiguating int64 values is definitely achievable without much work.
Given that the API for Deployment and DeamonSet both went through community design review prior to implementation and merge, that there is no measurable performance benefit to using an int32 in this case, that we use int64 in many other places in the API, and that we don't have an actual issue to motivate changing all the workloads API objects, I don't see why we should switch this field to int32.
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 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.
Discussed. We should convert to int32 in bulk.
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.
SGTM. Will have a PR to convert all.
/test pull-kubernetes-unit |
@thockin replied to your comment. PTAL. Thanks! |
/retest |
/lgtm |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kow3ns, liyinan926, thockin Associated issue: 49909 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
@liyinan926 do you remember why the PR had two merge commits "Merge branch 'master' of github.com:kubernetes/kubernetes"? Did you merge your local branch with kubernetes/kubernetes master branch before submitting the PR? @sttts reported this PR broke the publishing robot because the robot skipped merge commits while in case of this PR, the merge commits are non-empty. |
@caesarxuchao @sttts I don't remember exactly why but I did pulled the master branch and rebased before the PR was approved and submitted. |
Automatic merge from submit-queue Added field CollisionCount to StatefulSetStatus **What this PR does / why we need it**: This PR added a new field `CollisionCount` into `StatefulSetStatus`, similarly in terms of both name and semantics to the existing `CollisionCount` field in `DaemonSetStatus`. The field will be used for collision avoidance when the `StatefulSet` controller creates name for the newest ControllerRevision, which will be done in another PR. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: kubernetes#49909. **Special notes for your reviewer**: A second PR will include logic that actually uses the field for collision avoidance. **Release note**: ```release-note Added field CollisionCount to StatefulSetStatus in both apps/v1beta1 and apps/v1beta2 ```
What this PR does / why we need it:
This PR added a new field
CollisionCount
intoStatefulSetStatus
, similarly in terms of both name and semantics to the existingCollisionCount
field inDaemonSetStatus
. The field will be used for collision avoidance when theStatefulSet
controller creates name for the newest ControllerRevision, which will be done in another PR.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): #49909.Special notes for your reviewer:
A second PR will include logic that actually uses the field for collision avoidance.
Release note: