Fix error when query node release collection

Signed-off-by: xige-16 <xi.ge@zilliz.com>
pull/4973/head^2
xige-16 2021-02-07 15:56:57 +08:00 committed by yefu.chen
parent 2ca53fa668
commit c7ac238aac
2 changed files with 10 additions and 1 deletions

View File

@ -203,7 +203,11 @@ func (mp *metaReplicaImpl) releaseCollection(dbID UniqueID, collectionID UniqueI
if collections, ok := mp.db2collections[dbID]; ok {
for i, collection := range collections {
if collectionID == collection.id {
collections = append(collections[:i], collections[i+1:]...)
if i+1 < len(collections) {
collections = append(collections[:i], collections[i+1:]...)
} else {
collections = collections[:i]
}
return nil
}
}

View File

@ -246,6 +246,7 @@ func (qs *QueryService) LoadCollection(req *querypb.LoadCollectionRequest) (*com
func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest) (*commonpb.Status, error) {
dbID := req.DbID
collectionID := req.CollectionID
fmt.Println("release collection start, collectionID = ", collectionID)
partitions, err := qs.replica.getPartitions(dbID, collectionID)
if err != nil {
return &commonpb.Status{
@ -275,6 +276,8 @@ func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest)
Reason: err.Error(),
}, err
}
fmt.Println("release collection end")
//TODO:: queryNode cancel subscribe dmChannels
return status, err
}
@ -441,6 +444,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest)
collectionID := req.CollectionID
partitionIDs := req.PartitionIDs
segmentIDs := make([]UniqueID, 0)
fmt.Println("start release partitions start, partitionIDs = ", partitionIDs)
for _, partitionID := range partitionIDs {
segments, err := qs.replica.getSegments(dbID, collectionID, partitionID)
if err != nil {
@ -478,6 +482,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest)
}
}
fmt.Println("start release partitions end")
//TODO:: queryNode cancel subscribe dmChannels
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,