From 3c688f83cabe38657d76d2c2e3e7ca11049821f4 Mon Sep 17 00:00:00 2001 From: runkecheng <1131648942@qq.com> Date: Tue, 30 Nov 2021 10:50:59 +0800 Subject: [PATCH] syncer: Use the revision to determine if the POD needs to be updated. #320 --- mysqlcluster/syncer/statefulset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqlcluster/syncer/statefulset.go b/mysqlcluster/syncer/statefulset.go index e41ea4ee..1b785fac 100644 --- a/mysqlcluster/syncer/statefulset.go +++ b/mysqlcluster/syncer/statefulset.go @@ -289,7 +289,7 @@ 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.UpdatedReplicas >= s.sfs.Status.Replicas { + if s.sfs.Status.UpdateRevision == s.sfs.Status.CurrentRevision { return nil }