Skip to content

Commit

Permalink
fix agent
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesCheung96 committed Nov 29, 2023
1 parent 8fb72da commit d48b885
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cdc/scheduler/internal/v3/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,26 @@ func newAgent(
return nil, err
}

var ownerCaptureInfo *model.CaptureInfo
_, captures, err := etcdClient.GetCaptures(ctx)
for _, captureInfo := range captures {
if captureInfo.ID == ownerCaptureID {
ownerCaptureInfo = captureInfo
break
}
}
if ownerCaptureInfo == nil {
log.Info("schedulerv3: no owner found. We will wait for an owner to contact us.",
zap.String("namespace", changeFeedID.Namespace),
zap.String("changefeed", changeFeedID.ID),
zap.Error(err))
return result, nil
}

result.compat.UpdateCaptureInfo(map[model.CaptureID]*model.CaptureInfo{
ownerCaptureID: ownerCaptureInfo,
})

result.ownerInfo = ownerInfo{
// owner's version can only be got by receiving heartbeat
Version: "",
Expand Down

0 comments on commit d48b885

Please sign in to comment.