Skip to content

Commit

Permalink
enhance: Init ChannelCP when creating a channel (#35388)
Browse files Browse the repository at this point in the history
pr: #35387

Signed-off-by: yangxuan <[email protected]>
  • Loading branch information
XuanYang-cn authored Aug 14, 2024
1 parent ce53e79 commit 0fb3bf4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/datacoord/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,17 @@ func (s *Server) WatchChannels(ctx context.Context, req *datapb.WatchChannelsReq
resp.Status = merr.Status(err)
return resp, nil
}

// try to init channel checkpoint, if failed, we will log it and continue
startPos := toMsgPosition(channelName, req.GetStartPositions())
if startPos != nil {
startPos.Timestamp = req.GetCreateTimestamp()
if err := s.meta.UpdateChannelCheckpoint(channelName, startPos); err != nil {
log.Warn("failed to init channel checkpoint, meta update error", zap.String("channel", channelName), zap.Error(err))
}
} else {
log.Info("skip to init channel checkpoint for nil startPosition", zap.String("channel", channelName))
}
}

return resp, nil
Expand Down

0 comments on commit 0fb3bf4

Please sign in to comment.