Add retry on getChannelLatestMsgID (#24518)

Signed-off-by: wayblink <anyang.wang@zilliz.com>
This commit is contained in:
wayblink 2023-05-30 20:03:28 +08:00 committed by GitHub
parent 39d31f8bbf
commit 5958b42941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -557,7 +557,12 @@ func (node *DataNode) AddImportSegment(ctx context.Context, req *datapb.AddImpor
}, nil
}
// Get the current dml channel position ID, that will be used in segments start positions and end positions.
posID, err := ds.getChannelLatestMsgID(context.Background(), req.GetChannelName(), req.GetSegmentId())
var posID []byte
err = retry.Do(ctx, func() error {
id, innerError := ds.getChannelLatestMsgID(context.Background(), req.GetChannelName(), req.GetSegmentId())
posID = id
return innerError
}, retry.Attempts(30))
if err != nil {
return &datapb.AddImportSegmentResponse{
Status: merr.Status(merr.WrapErrChannelNotFound(