diff --git a/micro-cluster/cluster/switchover/switchover.go b/micro-cluster/cluster/switchover/switchover.go index 053f25d48..266426bfb 100644 --- a/micro-cluster/cluster/switchover/switchover.go +++ b/micro-cluster/cluster/switchover/switchover.go @@ -379,7 +379,7 @@ func (m *Manager) clusterGetRelationByMasterSlaveClusterId(ctx context.Context, return nil, err } for _, v := range relations { - if v.SubjectClusterID == masterClusterId && v.RelationType == constants.ClusterRelationSlaveTo { + if v.SubjectClusterID == masterClusterId && v.RelationType == constants.ClusterRelationStandBy { relation = v break } diff --git a/micro-cluster/cluster/switchover/switchover_test.go b/micro-cluster/cluster/switchover/switchover_test.go index 162046fa7..f91d19df2 100644 --- a/micro-cluster/cluster/switchover/switchover_test.go +++ b/micro-cluster/cluster/switchover/switchover_test.go @@ -38,7 +38,7 @@ func TestSwitchover(t *testing.T) { clusterRW.EXPECT().GetRelations(gomock.Any(), gomock.Eq("2")).Return( []*clusterMgr.ClusterRelation{ { - RelationType: constants.ClusterRelationSlaveTo, + RelationType: constants.ClusterRelationStandBy, SubjectClusterID: "1", ObjectClusterID: "2", SyncChangeFeedTaskID: "1", diff --git a/micro-cluster/cluster/switchover/workflow_test.go b/micro-cluster/cluster/switchover/workflow_test.go index c93254556..0dc1ac1a9 100644 --- a/micro-cluster/cluster/switchover/workflow_test.go +++ b/micro-cluster/cluster/switchover/workflow_test.go @@ -38,7 +38,7 @@ func TestWorkFlowToDO(t *testing.T) { clusterRW.EXPECT().GetRelations(gomock.Any(), gomock.Eq("2")).Return( []*clusterMgr.ClusterRelation{ { - RelationType: constants.ClusterRelationSlaveTo, + RelationType: constants.ClusterRelationStandBy, SubjectClusterID: "1", ObjectClusterID: "2", SyncChangeFeedTaskID: "1", diff --git a/models/cluster/management/readwriteimpl.go b/models/cluster/management/readwriteimpl.go index 611b997e3..aa3307874 100644 --- a/models/cluster/management/readwriteimpl.go +++ b/models/cluster/management/readwriteimpl.go @@ -349,7 +349,7 @@ func (g *ClusterReadWrite) SwapMasterSlaveRelation(ctx context.Context, oldMaste } err := tx.Delete(&ClusterRelation{ - RelationType: constants.ClusterRelationSlaveTo, + RelationType: constants.ClusterRelationStandBy, ObjectClusterID: oldSlaveClusterId, SubjectClusterID: oldMasterClusterId, }).Error @@ -358,7 +358,7 @@ func (g *ClusterReadWrite) SwapMasterSlaveRelation(ctx context.Context, oldMaste return err } err = tx.Create(&ClusterRelation{ - RelationType: constants.ClusterRelationSlaveTo, + RelationType: constants.ClusterRelationStandBy, ObjectClusterID: oldMasterClusterId, SubjectClusterID: oldSlaveClusterId, SyncChangeFeedTaskID: newSyncChangeFeedTaskId,