Discard SyncDistribution set action from legacy querycoord (#27027)

Since Milvus in lower version (< 2.3.0), there is no load info in set action
which may corrupt data integrity and cause panicking

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/27014/head
congqixia 2023-09-13 09:35:18 +08:00 committed by GitHub
parent dd2cb1d44a
commit 394c898b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -469,7 +469,7 @@ func (loader *segmentLoader) LoadBloomFilterSet(ctx context.Context, collectionI
log := log.Ctx(ctx).With(
zap.Int64("collectionID", collectionID),
zap.Int64s("segmentIDs", lo.Map(infos, func(info *querypb.SegmentLoadInfo, _ int) int64 {
return info.SegmentID
return info.GetSegmentID()
})),
)

View File

@ -1376,6 +1376,10 @@ func (node *QueryNode) SyncDistribution(ctx context.Context, req *querypb.SyncDi
case querypb.SyncType_Remove:
removeActions = append(removeActions, action)
case querypb.SyncType_Set:
if action.GetInfo() == nil {
log.Warn("sync request from legacy querycoord without load info, skip")
continue
}
addSegments[action.GetNodeID()] = append(addSegments[action.GetNodeID()], action.GetInfo())
case querypb.SyncType_UpdateVersion:
pipeline := node.pipelineManager.Get(req.GetChannel())

View File

@ -1758,7 +1758,7 @@ func (suite *ServiceSuite) TestSyncDistribution_Normal() {
req.Actions = []*querypb.SyncAction{releaseAction, setAction}
status, err := suite.node.SyncDistribution(ctx, req)
suite.NoError(err)
suite.Equal(commonpb.ErrorCode_UnexpectedError, status.ErrorCode)
suite.Equal(commonpb.ErrorCode_Success, status.ErrorCode)
syncVersionAction := &querypb.SyncAction{
Type: querypb.SyncType_UpdateVersion,