提交 c7ac238a 编写于 作者: X xige-16 提交者: yefu.chen

Fix error when query node release collection

Signed-off-by: Nxige-16 <xi.ge@zilliz.com>
上级 2ca53fa6
...@@ -203,7 +203,11 @@ func (mp *metaReplicaImpl) releaseCollection(dbID UniqueID, collectionID UniqueI ...@@ -203,7 +203,11 @@ func (mp *metaReplicaImpl) releaseCollection(dbID UniqueID, collectionID UniqueI
if collections, ok := mp.db2collections[dbID]; ok { if collections, ok := mp.db2collections[dbID]; ok {
for i, collection := range collections { for i, collection := range collections {
if collectionID == collection.id { 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 return nil
} }
} }
......
...@@ -246,6 +246,7 @@ func (qs *QueryService) LoadCollection(req *querypb.LoadCollectionRequest) (*com ...@@ -246,6 +246,7 @@ func (qs *QueryService) LoadCollection(req *querypb.LoadCollectionRequest) (*com
func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest) (*commonpb.Status, error) { func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest) (*commonpb.Status, error) {
dbID := req.DbID dbID := req.DbID
collectionID := req.CollectionID collectionID := req.CollectionID
fmt.Println("release collection start, collectionID = ", collectionID)
partitions, err := qs.replica.getPartitions(dbID, collectionID) partitions, err := qs.replica.getPartitions(dbID, collectionID)
if err != nil { if err != nil {
return &commonpb.Status{ return &commonpb.Status{
...@@ -275,6 +276,8 @@ func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest) ...@@ -275,6 +276,8 @@ func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest)
Reason: err.Error(), Reason: err.Error(),
}, err }, err
} }
fmt.Println("release collection end")
//TODO:: queryNode cancel subscribe dmChannels //TODO:: queryNode cancel subscribe dmChannels
return status, err return status, err
} }
...@@ -441,6 +444,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest) ...@@ -441,6 +444,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest)
collectionID := req.CollectionID collectionID := req.CollectionID
partitionIDs := req.PartitionIDs partitionIDs := req.PartitionIDs
segmentIDs := make([]UniqueID, 0) segmentIDs := make([]UniqueID, 0)
fmt.Println("start release partitions start, partitionIDs = ", partitionIDs)
for _, partitionID := range partitionIDs { for _, partitionID := range partitionIDs {
segments, err := qs.replica.getSegments(dbID, collectionID, partitionID) segments, err := qs.replica.getSegments(dbID, collectionID, partitionID)
if err != nil { if err != nil {
...@@ -478,6 +482,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest) ...@@ -478,6 +482,7 @@ func (qs *QueryService) ReleasePartitions(req *querypb.ReleasePartitionRequest)
} }
} }
fmt.Println("start release partitions end")
//TODO:: queryNode cancel subscribe dmChannels //TODO:: queryNode cancel subscribe dmChannels
return &commonpb.Status{ return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS, ErrorCode: commonpb.ErrorCode_SUCCESS,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册