enhance: change protection to RLock for loadStreamDelete (#29450)

See also: #29332

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2023-12-25 23:27:02 +08:00 committed by GitHub
parent 1d6bcd1ded
commit ac95c52171
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ type shardDelegator struct {
level0Mut sync.RWMutex
level0Deletions map[int64]*storage.DeleteData // partitionID -> deletions
// stream delete buffer
deleteMut sync.Mutex
deleteMut sync.RWMutex
deleteBuffer deletebuffer.DeleteBuffer[*deletebuffer.Item]
// dispatcherClient msgdispatcher.Client
factory msgstream.Factory

View File

@ -570,8 +570,8 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
return candidate.ID(), candidate
})
sd.deleteMut.Lock()
defer sd.deleteMut.Unlock()
sd.deleteMut.RLock()
defer sd.deleteMut.RUnlock()
// apply buffered delete for new segments
// no goroutines here since qnv2 has no load merging logic
for _, info := range infos {