Skip to content

Commit

Permalink
Merge pull request radondb#314 from runkecheng/fix_deleting_node_label
Browse files Browse the repository at this point in the history
syncer: Set the health label to `no` before updating pod. radondb#310
  • Loading branch information
andyli029 authored Dec 1, 2021
2 parents 8dcae49 + 448bb75 commit 78ec4ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mysqlcluster/syncer/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,12 @@ func (s *StatefulSetSyncer) applyNWait(ctx context.Context, pod *corev1.Pod) err
if pod.DeletionTimestamp != nil {
log.Info("pod is being deleted", "pod", pod.Name, "key", s.Unwrap())
} else {
// If healthy is always `yes`, retry() will exit in advance, which may
// cause excessive nodes are deleted at the same time, details: issue#310.
pod.ObjectMeta.Labels["healthy"] = "no"
if err := s.cli.Update(ctx, pod); err != nil {
return err
}
if err := s.cli.Delete(ctx, pod); err != nil {
return err
}
Expand Down

0 comments on commit 78ec4ec

Please sign in to comment.