Fix panic at loadSegment during rolling upgrade (#27671)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/27703/head
yihao.dai 2023-10-13 16:31:35 +08:00 committed by GitHub
parent fc1d59f64b
commit d9431266bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -435,11 +435,16 @@ func (sd *shardDelegator) loadStreamDelete(ctx context.Context,
defer sd.deleteMut.Unlock()
// apply buffered delete for new segments
// no goroutines here since qnv2 has no load merging logic
for i, info := range infos {
for _, info := range infos {
candidate := idCandidates[info.GetSegmentID()]
position := info.GetDeltaPosition()
if position == nil { // for compatibility of rolling upgrade from 2.2.x to 2.3
position = deltaPositions[i]
// During rolling upgrade, Querynode(2.3) may receive merged LoadSegmentRequest
// from QueryCoord(2.2); In version 2.2.x, only segments with the same dmlChannel
// can be merged, and deltaPositions will be merged into a single deltaPosition,
// so we should use `deltaPositions[0]` as the seek position for all the segments
// within the same LoadSegmentRequest.
position = deltaPositions[0]
}
deleteData := &storage.DeleteData{}