-
Notifications
You must be signed in to change notification settings - Fork 22
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
pods are deleted without waiting for completion when switchover takes a long time #751
base: main
Are you sure you want to change the base?
Conversation
54a247a
to
b548265
Compare
6c8c8cc
to
2c800d7
Compare
2c800d7
to
7dd3bd9
Compare
7dd3bd9
to
0495e7d
Compare
0495e7d
to
2d8b5d9
Compare
03952e4
to
0d8765e
Compare
0d8765e
to
c3c6f62
Compare
f34f331
to
21ce59b
Compare
21ce59b
to
aa234b3
Compare
if _, exists := primary.Annotations[constants.AnnPreventDelete]; !exists { | ||
logFromContext(ctx).Info("replication delay detected, prevent pod deletion", "instance", ss.Primary) | ||
primary.Annotations[constants.AnnPreventDelete] = "true" | ||
p.client.Update(ctx, primary) |
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.
I think Patch method is better here like below.
Line 188 in 6693ced
if err := p.client.Patch(ctx, newPod, client.MergeFrom(ppod)); err != nil { |
@@ -235,6 +235,46 @@ func (p *managerProcess) GatherStatus(ctx context.Context) (*StatusSet, error) { | |||
ss.ExecutedGTID = pst.GlobalVariables.ExecutedGTID | |||
} | |||
|
|||
// detect replication delay | |||
if cluster.Spec.MaxDelaySecondsForPodDeletion > 0 { |
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.
GatherStatus function should only collect status and return as StatusSet.
Updating the resource should not be done here.
#747