From 7158f00f66bf4c816e8a602fef14155cf47dc3a1 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Fri, 7 Jan 2022 10:52:44 +0800 Subject: [PATCH] tests(ticdc): resolve conflicts --- cdc/owner/owner.go | 7 ------- pkg/version/creator_version_gate.go | 6 +++--- pkg/version/creator_version_gate_test.go | 8 ++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cdc/owner/owner.go b/cdc/owner/owner.go index 65145ade696..ed32cc29b68 100644 --- a/cdc/owner/owner.go +++ b/cdc/owner/owner.go @@ -79,16 +79,12 @@ type Owner struct { ownerJobQueue []*ownerJob lastTickTime time.Time -<<<<<<< HEAD closed int32 -======= - closed int32 // bootstrapped specifies whether the owner has been initialized. // This will only be done when the owner starts the first Tick. // NOTICE: Do not use it in a method other than tick unexpectedly, as it is not a thread-safe value. bootstrapped bool ->>>>>>> 944295563 (owner(ticdc): Add bootstrap and try to fix the meta information in it (#3838)) newChangefeed func(id model.ChangeFeedID, gcManager gc.Manager) *changefeed } @@ -150,11 +146,8 @@ func (o *Owner) Tick(stdCtx context.Context, rawState orchestrator.ReactorState) return nil, errors.Trace(err) } -<<<<<<< HEAD o.handleJobs() -======= ctx := stdCtx.(cdcContext.Context) ->>>>>>> 944295563 (owner(ticdc): Add bootstrap and try to fix the meta information in it (#3838)) for changefeedID, changefeedState := range state.Changefeeds { if changefeedState.Info == nil { o.cleanUpChangefeed(changefeedState) diff --git a/pkg/version/creator_version_gate.go b/pkg/version/creator_version_gate.go index a1e235fe46c..30102682e06 100644 --- a/pkg/version/creator_version_gate.go +++ b/pkg/version/creator_version_gate.go @@ -27,9 +27,9 @@ type CreatorVersionGate struct { // which we use the admin job type to control the state of the changefeed. var changefeedStateFromAdminJobVersions = []semver.Version{ // Introduced in https://github.com/pingcap/ticdc/pull/3014. - *semver.New("4.0.14"), + *semver.New("4.0.16"), // Introduced in https://github.com/pingcap/ticdc/pull/2946. - *semver.New("5.0.5"), + *semver.New("5.0.6"), } // NewCreatorVersionGate creates the creator version gate. @@ -52,7 +52,7 @@ func (f *CreatorVersionGate) ChangefeedStateFromAdminJob() bool { for _, version := range changefeedStateFromAdminJobVersions { // NOTICE: To compare against the same major version. if creatorVersion.Major == version.Major && - (creatorVersion.Equal(version) || creatorVersion.LessThan(version)) { + creatorVersion.LessThan(version) { return true } } diff --git a/pkg/version/creator_version_gate_test.go b/pkg/version/creator_version_gate_test.go index 5c5e0fa6041..45e0a9c5bd4 100644 --- a/pkg/version/creator_version_gate_test.go +++ b/pkg/version/creator_version_gate_test.go @@ -40,6 +40,10 @@ func TestChangefeedStateFromAdminJob(t *testing.T) { }, { creatorVersion: "4.0.15", + expected: true, + }, + { + creatorVersion: "4.0.16", expected: false, }, { @@ -50,6 +54,10 @@ func TestChangefeedStateFromAdminJob(t *testing.T) { creatorVersion: "5.0.1", expected: true, }, + { + creatorVersion: "5.0.6", + expected: false, + }, { creatorVersion: "5.1.0", expected: false,