mirror of https://github.com/milvus-io/milvus.git
Fix read lock to write lock (#19464)
Signed-off-by: yangxuan <xuan.yang@zilliz.com> Signed-off-by: yangxuan <xuan.yang@zilliz.com>pull/19450/head
parent
2c7257c2ee
commit
f6e7b92db6
|
@ -643,8 +643,8 @@ func (replica *SegmentReplica) hasSegment(segID UniqueID, countFlushed bool) boo
|
||||||
return inNew || inNormal || inFlush
|
return inNew || inNormal || inFlush
|
||||||
}
|
}
|
||||||
func (replica *SegmentReplica) refreshFlushedSegStatistics(segID UniqueID, numRows int64) {
|
func (replica *SegmentReplica) refreshFlushedSegStatistics(segID UniqueID, numRows int64) {
|
||||||
replica.segMu.RLock()
|
replica.segMu.Lock()
|
||||||
defer replica.segMu.RUnlock()
|
defer replica.segMu.Unlock()
|
||||||
|
|
||||||
if seg, ok := replica.flushedSegments[segID]; ok {
|
if seg, ok := replica.flushedSegments[segID]; ok {
|
||||||
seg.memorySize = 0
|
seg.memorySize = 0
|
||||||
|
|
Loading…
Reference in New Issue