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

Refactor release collection warn message

Signed-off-by: Nxige-16 <xi.ge@zilliz.com>
上级 bf75c2fb
package queryservice package queryservice
import ( import (
"strconv"
"github.com/zilliztech/milvus-distributed/internal/errors" "github.com/zilliztech/milvus-distributed/internal/errors"
"github.com/zilliztech/milvus-distributed/internal/proto/querypb" "github.com/zilliztech/milvus-distributed/internal/proto/querypb"
"github.com/zilliztech/milvus-distributed/internal/proto/schemapb" "github.com/zilliztech/milvus-distributed/internal/proto/schemapb"
...@@ -212,7 +214,9 @@ func (mp *metaReplicaImpl) releaseCollection(dbID UniqueID, collectionID UniqueI ...@@ -212,7 +214,9 @@ func (mp *metaReplicaImpl) releaseCollection(dbID UniqueID, collectionID UniqueI
} }
} }
} }
return errors.New("releaseCollection: can't find dbID or collectionID")
errorStr := "releaseCollection: can't find dbID or collectionID " + strconv.FormatInt(collectionID, 10)
return errors.New(errorStr)
} }
func (mp *metaReplicaImpl) releasePartition(dbID UniqueID, collectionID UniqueID, partitionID UniqueID) error { func (mp *metaReplicaImpl) releasePartition(dbID UniqueID, collectionID UniqueID, partitionID UniqueID) error {
...@@ -226,7 +230,9 @@ func (mp *metaReplicaImpl) releasePartition(dbID UniqueID, collectionID UniqueID ...@@ -226,7 +230,9 @@ func (mp *metaReplicaImpl) releasePartition(dbID UniqueID, collectionID UniqueID
} }
} }
} }
return errors.New("releasePartition: can't find dbID or collectionID or partitionID")
errorStr := "releasePartition: can't find dbID or collectionID or partitionID " + strconv.FormatInt(partitionID, 10)
return errors.New(errorStr)
} }
func (mp *metaReplicaImpl) addDmChannels(dbID UniqueID, collectionID UniqueID, channels2NodeID map[string]int64) error { func (mp *metaReplicaImpl) addDmChannels(dbID UniqueID, collectionID UniqueID, channels2NodeID map[string]int64) error {
......
...@@ -282,21 +282,23 @@ func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest) ...@@ -282,21 +282,23 @@ func (qs *QueryService) ReleaseCollection(req *querypb.ReleaseCollectionRequest)
fmt.Println("release collection start, collectionID = ", collectionID) fmt.Println("release collection start, collectionID = ", collectionID)
_, err := qs.replica.getCollectionByID(dbID, collectionID) _, err := qs.replica.getCollectionByID(dbID, collectionID)
if err != nil { if err != nil {
fmt.Println("release collection end, query service don't have the log of collection ", collectionID)
return &commonpb.Status{ return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR, ErrorCode: commonpb.ErrorCode_SUCCESS,
Reason: err.Error(), }, nil
}, err
} }
for _, node := range qs.queryNodes { for nodeID, node := range qs.queryNodes {
status, err := node.ReleaseCollection(req) status, err := node.ReleaseCollection(req)
if err != nil { if err != nil {
fmt.Println("release collection end, node ", nodeID, " occur error")
return status, err return status, err
} }
} }
err = qs.replica.releaseCollection(dbID, collectionID) err = qs.replica.releaseCollection(dbID, collectionID)
if err != nil { if err != nil {
fmt.Println("release collection end, query service release replica error")
return &commonpb.Status{ return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR, ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
Reason: err.Error(), Reason: err.Error(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册