Skip to content

Commit

Permalink
owner: fix the owner panic (#1964) #1967
Browse files Browse the repository at this point in the history
Co-authored-by: leoppro <[email protected]>
  • Loading branch information
ti-chi-bot and leoppro authored Jun 7, 2021
1 parent fcd5552 commit 473d60a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cdc/model/reactor_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func (s *ChangefeedReactorState) GetPatches() []orchestrator.DataPatch {
func (s *ChangefeedReactorState) CheckChangefeedNormal() {
s.skipPatchesInThisTick = false
s.PatchInfo(func(info *ChangeFeedInfo) (*ChangeFeedInfo, bool, error) {
if info.AdminJobType.IsStopState() {
if info == nil || info.AdminJobType.IsStopState() {
s.skipPatchesInThisTick = true
return info, false, cerrors.ErrEtcdTryAgain.GenWithStackByArgs()
}
Expand Down
2 changes: 2 additions & 0 deletions cdc/model/reactor_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,8 @@ func (s *stateSuite) TestCheckChangefeedNormal(c *check.C) {
defer testleak.AfterTest(c)()
state := NewChangefeedReactorState("test1")
stateTester := orchestrator.NewReactorStateTester(c, state, nil)
state.CheckChangefeedNormal()
stateTester.MustApplyPatches()
state.PatchInfo(func(info *ChangeFeedInfo) (*ChangeFeedInfo, bool, error) {
return &ChangeFeedInfo{SinkURI: "123", AdminJobType: AdminNone, Config: &config.ReplicaConfig{}}, true, nil
})
Expand Down

0 comments on commit 473d60a

Please sign in to comment.