-
Notifications
You must be signed in to change notification settings - Fork 84
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
syncer: Optimize the logic of updating pod. #503
Conversation
43be7d9
to
dc2e03e
Compare
Is related to: kubernetes/kubernetes#106059 |
|
dc2e03e
to
d649391
Compare
2e0c3c7
to
d0c94e0
Compare
updatedRevision wiil not update with the currentRevision when using `onDelete`. Use sfs.status.UpdatedRplicas and sfs.spec.Replicas to determine whether the update is completed.
d0c94e0
to
134937d
Compare
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
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
mysqlcluster/syncer/statefulset.go
Outdated
@@ -298,7 +298,9 @@ func (s *StatefulSetSyncer) createOrUpdate(ctx context.Context) (controllerutil. | |||
// updatePod update the pods, update follower nodes first. | |||
// This can reduce the number of master-slave switching during the update process. | |||
func (s *StatefulSetSyncer) updatePod(ctx context.Context) error { | |||
if s.sfs.Status.UpdateRevision == s.sfs.Status.CurrentRevision { | |||
// updatedRevision wiil not update with the currentRevision when using `onDelete`. |
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.
wiil -> will
* fix(cluster): update too many pods at the same time. * fix(cluster): adjust the exit logic of updatePod(). updatedRevision wiil not update with the currentRevision when using `onDelete`. Use sfs.status.UpdatedRplicas and sfs.spec.Replicas to determine whether the update is completed. * feat(cluster): actively switch leader to updated pod. * fix(cluster): wait pod healthy when updating
What type of PR is this?
/bug
/enhancement
Which issue(s) this PR fixes?
Fixes #502 #310
What this PR does?
Summary:
After deleting the pod, wait for the pod to restart.
Use updatedReplicas and Spec.replicas to judge if the updatepod() is needed.
Special notes for your reviewer?