mirror of https://github.com/milvus-io/milvus.git
Fix bug for umarshal index model (#18959)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com> Signed-off-by: cai.zhang <cai.zhang@zilliz.com>pull/18975/head
parent
3cf6cf3802
commit
6d37b1db17
|
@ -435,10 +435,6 @@ func (mt *metaTable) IsExpire(buildID UniqueID) bool {
|
|||
}
|
||||
|
||||
func (mt *metaTable) checkParams(fieldIndex *model.Index, req *indexpb.CreateIndexRequest) bool {
|
||||
if fieldIndex.IsDeleted {
|
||||
return false
|
||||
}
|
||||
|
||||
if fieldIndex.IndexName != req.IndexName {
|
||||
return false
|
||||
}
|
||||
|
@ -491,6 +487,9 @@ func (mt *metaTable) HasSameReq(req *indexpb.CreateIndexRequest) (bool, UniqueID
|
|||
defer mt.indexLock.RUnlock()
|
||||
|
||||
for _, fieldIndex := range mt.collectionIndexes[req.CollectionID] {
|
||||
if fieldIndex.IsDeleted {
|
||||
continue
|
||||
}
|
||||
if !mt.checkParams(fieldIndex, req) {
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ func UnmarshalIndexModel(indexInfo *indexpb.FieldIndex) *Index {
|
|||
IndexName: indexInfo.IndexInfo.GetIndexName(),
|
||||
IsDeleted: indexInfo.GetDeleted(),
|
||||
CreateTime: indexInfo.CreateTime,
|
||||
TypeParams: nil,
|
||||
TypeParams: indexInfo.IndexInfo.GetTypeParams(),
|
||||
IndexParams: indexInfo.IndexInfo.GetIndexParams(),
|
||||
}
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ func MarshalIndexModel(index *Index) *indexpb.FieldIndex {
|
|||
|
||||
func CloneIndex(index *Index) *Index {
|
||||
clonedIndex := &Index{
|
||||
TenantID: index.TenantID,
|
||||
CollectionID: index.CollectionID,
|
||||
FieldID: index.FieldID,
|
||||
IndexID: index.IndexID,
|
||||
|
|
Loading…
Reference in New Issue