@@ -35,6 +35,7 @@ import (
35
35
. "github.com/milvus-io/milvus/internal/querycoordv2/params"
36
36
"github.com/milvus-io/milvus/internal/querycoordv2/session"
37
37
"github.com/milvus-io/milvus/internal/querycoordv2/utils"
38
+ "github.com/milvus-io/milvus/pkg/common"
38
39
"github.com/milvus-io/milvus/pkg/log"
39
40
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
40
41
"github.com/milvus-io/milvus/pkg/util/funcutil"
@@ -197,6 +198,8 @@ func (ex *Executor) loadSegment(task *SegmentTask, step int) error {
197
198
return err
198
199
}
199
200
201
+ ex .setMetricTypeForMetaInfo (loadMeta , indexInfos )
202
+
200
203
req := packLoadSegmentRequest (
201
204
task ,
202
205
action ,
@@ -550,6 +553,8 @@ func (ex *Executor) setDistribution(task *LeaderTask, step int) error {
550
553
return err
551
554
}
552
555
556
+ ex .setMetricTypeForMetaInfo (loadMeta , indexInfo )
557
+
553
558
req := & querypb.SyncDistributionRequest {
554
559
Base : commonpbutil .NewMsgBase (
555
560
commonpbutil .WithMsgType (commonpb .MsgType_LoadSegments ),
@@ -722,3 +727,15 @@ func (ex *Executor) getLoadInfo(ctx context.Context, collectionID, segmentID int
722
727
loadInfo := utils .PackSegmentLoadInfo (segment , channel .GetSeekPosition (), indexes )
723
728
return loadInfo , indexInfos , nil
724
729
}
730
+
731
+ // setMetricTypeForMetaInfo it's a compatibility method for rolling upgrade from 2.3.x to 2.4
732
+ func (ex * Executor ) setMetricTypeForMetaInfo (metaInfo * querypb.LoadMetaInfo , indexInfos []* indexpb.IndexInfo ) {
733
+ for _ , info := range indexInfos {
734
+ for _ , param := range info .IndexParams {
735
+ if param .GetKey () == common .MetricTypeKey {
736
+ metaInfo .MetricType = param .GetValue ()
737
+ return
738
+ }
739
+ }
740
+ }
741
+ }
0 commit comments