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

Refactor release collection warn message

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