Add log in AddImportSegment.getChannelLatestMsgID (#23480)

Signed-off-by: wayblink <anyang.wang@zilliz.com>
pull/23568/head
wayblink 2023-04-18 17:50:31 +08:00 committed by GitHub
parent 717f712062
commit b23723535c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -432,6 +432,7 @@ func (dsService *dataSyncService) getChannelLatestMsgID(ctx context.Context, cha
dmlStream.AsConsumer([]string{pChannelName}, subName, mqwrapper.SubscriptionPositionUnknown)
id, err := dmlStream.GetLatestMsgID(pChannelName)
if err != nil {
log.Error("fail to GetLatestMsgID", zap.String("pChannelName", pChannelName), zap.Error(err))
return nil, err
}
return id.Serialize(), nil

View File

@ -560,7 +560,8 @@ func (node *DataNode) AddImportSegment(ctx context.Context, req *datapb.AddImpor
posID, err := ds.getChannelLatestMsgID(context.Background(), req.GetChannelName(), req.GetSegmentId())
if err != nil {
return &datapb.AddImportSegmentResponse{
Status: merr.Status(merr.WrapErrChannelNotFound(req.ChannelName, "failed to get channel position")),
Status: merr.Status(merr.WrapErrChannelNotFound(
req.ChannelName, "failed to get channel position", err.Error())),
}, nil
}
// Add the new segment to the channel.