mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
Fix data race in LoadSegmentsTask (#17342)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
2763efc9b0
commit
c76b4ade01
@ -212,6 +212,10 @@ func (node *QueryNode) LoadSegments(ctx context.Context, in *queryPb.LoadSegment
|
||||
node: node,
|
||||
}
|
||||
|
||||
segmentIDs := make([]UniqueID, 0, len(in.GetInfos()))
|
||||
for _, info := range in.Infos {
|
||||
segmentIDs = append(segmentIDs, info.SegmentID)
|
||||
}
|
||||
err := node.scheduler.queue.Enqueue(dct)
|
||||
if err != nil {
|
||||
status := &commonpb.Status{
|
||||
@ -221,10 +225,7 @@ func (node *QueryNode) LoadSegments(ctx context.Context, in *queryPb.LoadSegment
|
||||
log.Warn(err.Error())
|
||||
return status, nil
|
||||
}
|
||||
segmentIDs := make([]UniqueID, 0)
|
||||
for _, info := range in.Infos {
|
||||
segmentIDs = append(segmentIDs, info.SegmentID)
|
||||
}
|
||||
|
||||
log.Info("loadSegmentsTask Enqueue done", zap.Int64("collectionID", in.CollectionID), zap.Int64s("segmentIDs", segmentIDs), zap.Int64("nodeID", Params.QueryNodeCfg.GetNodeID()))
|
||||
|
||||
waitFunc := func() (*commonpb.Status, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user