mirror of https://github.com/milvus-io/milvus.git
enhance: make delegator lock critical smaller (#36997)
issue: #36804 Signed-off-by: chyezh <chyezh@outlook.com>pull/36993/head
parent
70339820fa
commit
ac178eeea5
|
@ -878,6 +878,9 @@ func (sd *shardDelegator) ReleaseSegments(ctx context.Context, req *querypb.Rele
|
|||
case querypb.DataScope_Historical:
|
||||
sealed = lo.Map(req.GetSegmentIDs(), convertSealed)
|
||||
}
|
||||
signal := sd.distribution.RemoveDistributions(sealed, growing)
|
||||
// wait cleared signal
|
||||
<-signal
|
||||
|
||||
if len(growing) > 0 {
|
||||
sd.growingSegmentLock.Lock()
|
||||
|
@ -893,9 +896,6 @@ func (sd *shardDelegator) ReleaseSegments(ctx context.Context, req *querypb.Rele
|
|||
})
|
||||
sd.AddExcludedSegments(droppedInfos)
|
||||
|
||||
signal := sd.distribution.RemoveDistributions(sealed, growing)
|
||||
// wait cleared signal
|
||||
<-signal
|
||||
if len(sealed) > 0 {
|
||||
sd.pkOracle.Remove(
|
||||
pkoracle.WithSegmentIDs(lo.Map(sealed, func(entry SegmentEntry, _ int) int64 { return entry.SegmentID })...),
|
||||
|
|
Loading…
Reference in New Issue