Skip to content

Commit

Permalink
tests(ticdc): resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Jan 7, 2022
1 parent 8bba4cb commit 7158f00
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
7 changes: 0 additions & 7 deletions cdc/owner/owner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/version/creator_version_gate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/version/creator_version_gate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func TestChangefeedStateFromAdminJob(t *testing.T) {
},
{
creatorVersion: "4.0.15",
expected: true,
},
{
creatorVersion: "4.0.16",
expected: false,
},
{
Expand All @@ -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,
Expand Down

0 comments on commit 7158f00

Please sign in to comment.