mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Fix data race caused by no clone while updating index (#21772)
Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
parent
ad6cbc990f
commit
78fd1987eb
@ -109,10 +109,12 @@ func (s *SegmentsInfo) SetSegmentIndex(segmentID UniqueID, segIndex *model.Segme
|
||||
)
|
||||
return
|
||||
}
|
||||
segment = segment.Clone()
|
||||
if segment.segmentIndexes == nil {
|
||||
segment.segmentIndexes = make(map[UniqueID]*model.SegmentIndex)
|
||||
}
|
||||
segment.segmentIndexes[segIndex.IndexID] = segIndex
|
||||
s.segments[segmentID] = segment
|
||||
}
|
||||
|
||||
func (s *SegmentsInfo) DropSegmentIndex(segmentID UniqueID, indexID UniqueID) {
|
||||
|
Loading…
Reference in New Issue
Block a user