diff --git a/pkg/manager/member/pd_upgrader.go b/pkg/manager/member/pd_upgrader.go index ac6ba09bec..f7651403e3 100644 --- a/pkg/manager/member/pd_upgrader.go +++ b/pkg/manager/member/pd_upgrader.go @@ -53,9 +53,10 @@ func (u *pdUpgrader) gracefulUpgrade(tc *v1alpha1.TidbCluster, oldSet *apps.Stat if !tc.Status.PD.Synced { return fmt.Errorf("tidbcluster: [%s/%s]'s pd status sync failed, can not to be upgraded", ns, tcName) } - if tc.PDScaling() { - klog.Infof("TidbCluster: [%s/%s]'s pd status is %v, can not upgrade pd", - ns, tcName, tc.Status.PD.Phase) + if tc.Status.TiCDC.Phase == v1alpha1.UpgradePhase || tc.Status.TiCDC.Phase == v1alpha1.ScalePhase || + tc.PDScaling() { + klog.Infof("TidbCluster: [%s/%s]'s ticdc status is %v, pd status is %v, can not upgrade pd", + ns, tcName, tc.Status.TiCDC.Phase, tc.Status.PD.Phase) _, podSpec, err := GetLastAppliedConfig(oldSet) if err != nil { return err diff --git a/pkg/manager/member/tidb_upgrader.go b/pkg/manager/member/tidb_upgrader.go index 8182ac85a8..a8d7119c08 100644 --- a/pkg/manager/member/tidb_upgrader.go +++ b/pkg/manager/member/tidb_upgrader.go @@ -60,13 +60,14 @@ func (u *tidbUpgrader) Upgrade(tc *v1alpha1.TidbCluster, oldSet *apps.StatefulSe tc.Status.TiKV.Phase == v1alpha1.UpgradePhase || tc.Status.TiKV.Phase == v1alpha1.ScalePhase || tc.Status.TiFlash.Phase == v1alpha1.UpgradePhase || tc.Status.TiFlash.Phase == v1alpha1.ScalePhase || tc.Status.Pump.Phase == v1alpha1.UpgradePhase || tc.Status.Pump.Phase == v1alpha1.ScalePhase || + tc.Status.TiCDC.Phase == v1alpha1.UpgradePhase || tc.Status.TiCDC.Phase == v1alpha1.ScalePhase || tc.TiDBScaling() { klog.Infof("TidbCluster: [%s/%s]'s pd status is %s, "+ "tikv status is %s, tiflash status is %s, pump status is %s, "+ - "tidb status is %s, can not upgrade tidb", + "tidb status is %s, ticdc status is %s, can not upgrade tidb", ns, tcName, tc.Status.PD.Phase, tc.Status.TiKV.Phase, tc.Status.TiFlash.Phase, - tc.Status.Pump.Phase, tc.Status.TiDB.Phase) + tc.Status.Pump.Phase, tc.Status.TiDB.Phase, tc.Status.TiCDC.Phase) _, podSpec, err := GetLastAppliedConfig(oldSet) if err != nil { return err diff --git a/pkg/manager/member/tikv_upgrader.go b/pkg/manager/member/tikv_upgrader.go index 06e6dd69f1..dc316d9dbc 100644 --- a/pkg/manager/member/tikv_upgrader.go +++ b/pkg/manager/member/tikv_upgrader.go @@ -503,6 +503,9 @@ func getStoreByOrdinal(name string, status v1alpha1.TiKVStatus, ordinal int32) * } func (u *tikvUpgrader) isTiKVReadyToUpgrade(tc *v1alpha1.TidbCluster) string { + if tc.Status.TiCDC.Phase == v1alpha1.UpgradePhase || tc.Status.TiCDC.Phase == v1alpha1.ScalePhase { + return fmt.Sprintf("ticdc status is %s", tc.Status.TiCDC.Phase) + } if tc.Status.TiFlash.Phase == v1alpha1.UpgradePhase || tc.Status.TiFlash.Phase == v1alpha1.ScalePhase { return fmt.Sprintf("tiflash status is %s", tc.Status.TiFlash.Phase) }