enhance: [2.4] Move forward l0 logic out of delta lock (#37340)

Cherry pick from master
pr: #37337
Related to #35303

`deleteMut` shall be protecting streaming delete buffer, forward l0
could be move out of the rlock section to reduce tsafe impact from
loading segments.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/37342/head
congqixia 2024-11-01 14:42:22 +08:00 committed by GitHub
parent 3c09d42bfc
commit ce7d4090f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 6 deletions

View File

@ -569,6 +569,15 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
})
deltaPositions := req.GetDeltaPositions()
for _, info := range infos {
candidate := idCandidates[info.GetSegmentID()]
// forward l0 deletion
err := sd.forwardL0Deletion(ctx, info, req, candidate, targetNodeID, worker)
if err != nil {
return err
}
}
sd.deleteMut.RLock()
defer sd.deleteMut.RUnlock()
// apply buffered delete for new segments
@ -598,12 +607,6 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
deleteScope = querypb.DataScope_Streaming
}
// forward l0 deletion
err := sd.forwardL0Deletion(ctx, info, req, candidate, targetNodeID, worker)
if err != nil {
return err
}
deleteData := &storage.DeleteData{}
// start position is dml position for segment
// if this position is before deleteBuffer's safe ts, it means some delete shall be read from msgstream