Add retry on getChannelLatestMsgID (#24520)

Signed-off-by: wayblink <anyang.wang@zilliz.com>
This commit is contained in:
wayblink 2023-05-30 20:33:29 +08:00 committed by GitHub
parent 421d29c99b
commit 9d2cc8e358
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1138,7 +1138,13 @@ 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: &commonpb.Status{