mirror of https://github.com/milvus-io/milvus.git
Use Wlock when release segment (#20092)
Signed-off-by: bigsheeper <yihao.dai@zilliz.com> Signed-off-by: bigsheeper <yihao.dai@zilliz.com>pull/20105/head
parent
c24244240e
commit
51e50bba73
|
@ -635,15 +635,15 @@ func (replica *metaReplica) removeSegment(segmentID UniqueID, segType segmentTyp
|
|||
case segmentTypeGrowing:
|
||||
if segment, ok := replica.growingSegments[segmentID]; ok {
|
||||
if collection, ok := replica.collections[segment.collectionID]; ok {
|
||||
collection.RLock()
|
||||
defer collection.RUnlock()
|
||||
collection.Lock()
|
||||
defer collection.Unlock()
|
||||
}
|
||||
}
|
||||
case segmentTypeSealed:
|
||||
if segment, ok := replica.sealedSegments[segmentID]; ok {
|
||||
if collection, ok := replica.collections[segment.collectionID]; ok {
|
||||
collection.RLock()
|
||||
defer collection.RUnlock()
|
||||
collection.Lock()
|
||||
defer collection.Unlock()
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue