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
XuanYang-cn 2022-09-27 11:50:57 +08:00 committed by GitHub
parent 2c7257c2ee
commit f6e7b92db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -643,8 +643,8 @@ func (replica *SegmentReplica) hasSegment(segID UniqueID, countFlushed bool) boo
return inNew || inNormal || inFlush
}
func (replica *SegmentReplica) refreshFlushedSegStatistics(segID UniqueID, numRows int64) {
replica.segMu.RLock()
defer replica.segMu.RUnlock()
replica.segMu.Lock()
defer replica.segMu.Unlock()
if seg, ok := replica.flushedSegments[segID]; ok {
seg.memorySize = 0