Skip to content

Commit

Permalink
enhance: make delegator lock critical smaller (#36997)
Browse files Browse the repository at this point in the history
issue: #36804

Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh authored Oct 21, 2024
1 parent 7033982 commit ac178ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/querynodev2/delegator/delegator_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 })...),
Expand Down

0 comments on commit ac178ee

Please sign in to comment.