Skip to content

Commit

Permalink
owner: fix the owner panic (pingcap#1964)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoppro authored and leoppro committed Jun 22, 2021
1 parent 581b86d commit f88913f
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 f88913f

Please sign in to comment.