@@ -3,6 +3,7 @@ package meta
3
3
import (
4
4
"fmt"
5
5
"sort"
6
+ "strings"
6
7
7
8
"github.com/milvus-io/milvus/internal/util/typeutil"
8
9
@@ -142,21 +143,32 @@ func combineToSegmentIndexesMeta220(segmentIndexes SegmentIndexesMeta210, indexB
142
143
if ! ok {
143
144
return nil , fmt .Errorf ("index build meta not found, segment id: %d, index id: %d, index build id: %d" , segID , indexID , record .GetBuildID ())
144
145
}
146
+
147
+ fileKeys := make ([]string , len (buildMeta .GetIndexFilePaths ()))
148
+ for i , filePath := range buildMeta .GetIndexFilePaths () {
149
+ parts := strings .Split (filePath , "/" )
150
+ if len (parts ) == 0 {
151
+ return nil , fmt .Errorf ("invaild index file path: %s" , filePath )
152
+ }
153
+
154
+ fileKeys [i ] = parts [len (parts )- 1 ]
155
+ }
156
+
145
157
segmentIndexModel := & model.SegmentIndex {
146
- SegmentID : segID ,
147
- CollectionID : record .GetCollectionID (),
148
- PartitionID : record .GetPartitionID (),
149
- NumRows : buildMeta .GetReq ().GetNumRows (),
150
- IndexID : indexID ,
151
- BuildID : record .GetBuildID (),
152
- NodeID : buildMeta .GetNodeID (),
153
- IndexVersion : buildMeta .GetIndexVersion (),
154
- IndexState : buildMeta .GetState (),
155
- FailReason : buildMeta .GetFailReason (),
156
- IsDeleted : buildMeta .GetMarkDeleted (),
157
- CreateTime : record .GetCreateTime (),
158
- IndexFilePaths : buildMeta . GetIndexFilePaths () ,
159
- IndexSize : buildMeta .GetSerializeSize (),
158
+ SegmentID : segID ,
159
+ CollectionID : record .GetCollectionID (),
160
+ PartitionID : record .GetPartitionID (),
161
+ NumRows : buildMeta .GetReq ().GetNumRows (),
162
+ IndexID : indexID ,
163
+ BuildID : record .GetBuildID (),
164
+ NodeID : buildMeta .GetNodeID (),
165
+ IndexVersion : buildMeta .GetIndexVersion (),
166
+ IndexState : buildMeta .GetState (),
167
+ FailReason : buildMeta .GetFailReason (),
168
+ IsDeleted : buildMeta .GetMarkDeleted (),
169
+ CreateTime : record .GetCreateTime (),
170
+ IndexFileKeys : fileKeys ,
171
+ IndexSize : buildMeta .GetSerializeSize (),
160
172
}
161
173
segmentIndexModels .AddRecord (segID , indexID , segmentIndexModel )
162
174
}
0 commit comments