-
Notifications
You must be signed in to change notification settings - Fork 442
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
RayCluster updates status frequently #1211
RayCluster updates status frequently #1211
Conversation
16aa211
to
8558a55
Compare
cc @msumitjain would you mind reviewing this PR? Thanks! |
cc @anshulomar would you mind reviewing this PR? Thanks! |
// status update will not be triggered. | ||
// | ||
// TODO (kevin85421): The field `ObservedGeneration` is not being well-maintained at the moment. In the future, | ||
// this field should be used to determine whether to update this CR or not. |
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.
do we have GH issue for this ObservedGeneration
fix?
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.
Good question. I will open an issue for it.
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.
Open an issue #1217.
oldStatus.MinWorkerReplicas, newStatus.MinWorkerReplicas, oldStatus.MaxWorkerReplicas, newStatus.MaxWorkerReplicas)) | ||
return true | ||
} | ||
if !reflect.DeepEqual(oldStatus.Endpoints, newStatus.Endpoints) || !reflect.DeepEqual(oldStatus.Head, newStatus.Head) { |
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.
any specific reason to not include this as part of if statement in line 296
?
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 merge L290, L296, and L305 into a single if
statement; however, the resulting log message will be very long and difficult for users to read.
RayCluster updates status frequently
Why are these changes needed?
This PR is similar to #1065. Without this PR, the RayCluster reconciler will update the CR's status in every reconciliation. Refer to the source code of ReplicaSet and StatefulSet. They will check the difference between the original status and the new status to determine whether update the status or not. Hence, this PR implements a similar function
inconsistentRayClusterStatus
to determine whether update status or not.Related issue number
#1182
Checks
I conducted an experiment similar to [DO NOT MERGE][Experiment] RayCluster updates status frequently #1214. In [DO NOT MERGE][Experiment] RayCluster updates status frequently #1214, the status update is called 8 times in 10 minutes. Let the number of reconciliations be N.
ctrl.Result{RequeueAfter: time.Duration(requeueAfterSeconds) * time.Second}
(with a default of 300 seconds). => O(N)The CR status update is called 3 times in 10 minutes.