Fix wrong error code in master_service_test.go

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2021-03-10 22:06:22 +08:00 committed by yefu.chen
parent ee9f67c216
commit 09ae985daa
53 changed files with 676 additions and 688 deletions

View File

@ -232,37 +232,29 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE(
"\010msg_type\030\001 \001(\0162\034.milvus.proto.common.Ms"
"gType\022\r\n\005msgID\030\002 \001(\003\022\021\n\ttimestamp\030\003 \001(\004\022"
"\020\n\010sourceID\030\004 \001(\003\"7\n\tMsgHeader\022*\n\004base\030\001"
" \001(\0132\034.milvus.proto.common.MsgBase*\353\006\n\tE"
"rrorCode\022\026\n\022ERROR_CODE_SUCCESS\020\000\022\037\n\033ERRO"
"R_CODE_UNEXPECTED_ERROR\020\001\022\035\n\031ERROR_CODE_"
"CONNECT_FAILED\020\002\022 \n\034ERROR_CODE_PERMISSIO"
"N_DENIED\020\003\022$\n ERROR_CODE_COLLECTION_NOT_"
"EXISTS\020\004\022\037\n\033ERROR_CODE_ILLEGAL_ARGUMENT\020"
"\005\022 \n\034ERROR_CODE_ILLEGAL_DIMENSION\020\007\022!\n\035E"
"RROR_CODE_ILLEGAL_INDEX_TYPE\020\010\022&\n\"ERROR_"
"CODE_ILLEGAL_COLLECTION_NAME\020\t\022\033\n\027ERROR_"
"CODE_ILLEGAL_TOPK\020\n\022 \n\034ERROR_CODE_ILLEGA"
"L_ROWRECORD\020\013\022 \n\034ERROR_CODE_ILLEGAL_VECT"
"OR_ID\020\014\022$\n ERROR_CODE_ILLEGAL_SEARCH_RES"
"ULT\020\r\022\035\n\031ERROR_CODE_FILE_NOT_FOUND\020\016\022\032\n\026"
"ERROR_CODE_META_FAILED\020\017\022\033\n\027ERROR_CODE_C"
"ACHE_FAILED\020\020\022#\n\037ERROR_CODE_CANNOT_CREAT"
"E_FOLDER\020\021\022!\n\035ERROR_CODE_CANNOT_CREATE_F"
"ILE\020\022\022#\n\037ERROR_CODE_CANNOT_DELETE_FOLDER"
"\020\023\022!\n\035ERROR_CODE_CANNOT_DELETE_FILE\020\024\022 \n"
"\034ERROR_CODE_BUILD_INDEX_ERROR\020\025\022\034\n\030ERROR"
"_CODE_ILLEGAL_NLIST\020\026\022\"\n\036ERROR_CODE_ILLE"
"GAL_METRIC_TYPE\020\027\022\034\n\030ERROR_CODE_OUT_OF_M"
"EMORY\020\030\022\036\n\032ERROR_CODE_INDEX_NOT_EXIST\020\031\022"
"\037\n\032ERROR_CODE_DD_REQUEST_RACE\020\350\007*\244\001\n\nInd"
"exState\022\024\n\020INDEX_STATE_NONE\020\000\022\030\n\024INDEX_S"
"TATE_UNISSUED\020\001\022\033\n\027INDEX_STATE_IN_PROGRE"
"SS\020\002\022\030\n\024INDEX_STATE_FINISHED\020\003\022\026\n\022INDEX_"
"STATE_FAILED\020\004\022\027\n\023INDEX_STATE_DELETED\020\005*"
"o\n\014SegmentState\022\017\n\013SegmentNone\020\000\022\023\n\017Segm"
"entNotExist\020\001\022\022\n\016SegmentGrowing\020\002\022\021\n\rSeg"
"mentSealed\020\003\022\022\n\016SegmentFlushed\020\004*\365\005\n\007Msg"
"Type\022\010\n\004None\020\000\022\024\n\020CreateCollection\020d\022\022\n\016"
" \001(\0132\034.milvus.proto.common.MsgBase*\245\004\n\tE"
"rrorCode\022\013\n\007Success\020\000\022\023\n\017UnexpectedError"
"\020\001\022\021\n\rConnectFailed\020\002\022\024\n\020PermissionDenie"
"d\020\003\022\027\n\023CollectionNotExists\020\004\022\023\n\017IllegalA"
"rgument\020\005\022\024\n\020IllegalDimension\020\007\022\024\n\020Illeg"
"alIndexType\020\010\022\031\n\025IllegalCollectionName\020\t"
"\022\017\n\013IllegalTOPK\020\n\022\024\n\020IllegalRowRecord\020\013\022"
"\023\n\017IllegalVectorID\020\014\022\027\n\023IllegalSearchRes"
"ult\020\r\022\020\n\014FileNotFound\020\016\022\016\n\nMetaFailed\020\017\022"
"\017\n\013CacheFailed\020\020\022\026\n\022CannotCreateFolder\020\021"
"\022\024\n\020CannotCreateFile\020\022\022\026\n\022CannotDeleteFo"
"lder\020\023\022\024\n\020CannotDeleteFile\020\024\022\023\n\017BuildInd"
"exError\020\025\022\020\n\014IllegalNLIST\020\026\022\025\n\021IllegalMe"
"tricType\020\027\022\017\n\013OutOfMemory\020\030\022\021\n\rIndexNotE"
"xist\020\031\022\022\n\rDDRequestRace\020\350\007*\244\001\n\nIndexStat"
"e\022\024\n\020INDEX_STATE_NONE\020\000\022\030\n\024INDEX_STATE_U"
"NISSUED\020\001\022\033\n\027INDEX_STATE_IN_PROGRESS\020\002\022\030"
"\n\024INDEX_STATE_FINISHED\020\003\022\026\n\022INDEX_STATE_"
"FAILED\020\004\022\027\n\023INDEX_STATE_DELETED\020\005*o\n\014Seg"
"mentState\022\017\n\013SegmentNone\020\000\022\023\n\017SegmentNot"
"Exist\020\001\022\022\n\016SegmentGrowing\020\002\022\021\n\rSegmentSe"
"aled\020\003\022\022\n\016SegmentFlushed\020\004*\373\005\n\007MsgType\022\016"
"\n\nUnSpecific\020\000\022\024\n\020CreateCollection\020d\022\022\n\016"
"DropCollection\020e\022\021\n\rHasCollection\020f\022\026\n\022D"
"escribeCollection\020g\022\023\n\017ShowCollections\020h"
"\022\024\n\020GetSystemConfigs\020i\022\022\n\016LoadCollection"
@ -298,7 +290,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_com
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_common_2eproto_once;
static bool descriptor_table_common_2eproto_initialized = false;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_common_2eproto = {
&descriptor_table_common_2eproto_initialized, descriptor_table_protodef_common_2eproto, "common.proto", 2388,
&descriptor_table_common_2eproto_initialized, descriptor_table_protodef_common_2eproto, "common.proto", 2068,
&descriptor_table_common_2eproto_once, descriptor_table_common_2eproto_sccs, descriptor_table_common_2eproto_deps, 7, 0,
schemas, file_default_instances, TableStruct_common_2eproto::offsets,
file_level_metadata_common_2eproto, 7, file_level_enum_descriptors_common_2eproto, file_level_service_descriptors_common_2eproto,

View File

@ -96,38 +96,38 @@ namespace proto {
namespace common {
enum ErrorCode : int {
ERROR_CODE_SUCCESS = 0,
ERROR_CODE_UNEXPECTED_ERROR = 1,
ERROR_CODE_CONNECT_FAILED = 2,
ERROR_CODE_PERMISSION_DENIED = 3,
ERROR_CODE_COLLECTION_NOT_EXISTS = 4,
ERROR_CODE_ILLEGAL_ARGUMENT = 5,
ERROR_CODE_ILLEGAL_DIMENSION = 7,
ERROR_CODE_ILLEGAL_INDEX_TYPE = 8,
ERROR_CODE_ILLEGAL_COLLECTION_NAME = 9,
ERROR_CODE_ILLEGAL_TOPK = 10,
ERROR_CODE_ILLEGAL_ROWRECORD = 11,
ERROR_CODE_ILLEGAL_VECTOR_ID = 12,
ERROR_CODE_ILLEGAL_SEARCH_RESULT = 13,
ERROR_CODE_FILE_NOT_FOUND = 14,
ERROR_CODE_META_FAILED = 15,
ERROR_CODE_CACHE_FAILED = 16,
ERROR_CODE_CANNOT_CREATE_FOLDER = 17,
ERROR_CODE_CANNOT_CREATE_FILE = 18,
ERROR_CODE_CANNOT_DELETE_FOLDER = 19,
ERROR_CODE_CANNOT_DELETE_FILE = 20,
ERROR_CODE_BUILD_INDEX_ERROR = 21,
ERROR_CODE_ILLEGAL_NLIST = 22,
ERROR_CODE_ILLEGAL_METRIC_TYPE = 23,
ERROR_CODE_OUT_OF_MEMORY = 24,
ERROR_CODE_INDEX_NOT_EXIST = 25,
ERROR_CODE_DD_REQUEST_RACE = 1000,
Success = 0,
UnexpectedError = 1,
ConnectFailed = 2,
PermissionDenied = 3,
CollectionNotExists = 4,
IllegalArgument = 5,
IllegalDimension = 7,
IllegalIndexType = 8,
IllegalCollectionName = 9,
IllegalTOPK = 10,
IllegalRowRecord = 11,
IllegalVectorID = 12,
IllegalSearchResult = 13,
FileNotFound = 14,
MetaFailed = 15,
CacheFailed = 16,
CannotCreateFolder = 17,
CannotCreateFile = 18,
CannotDeleteFolder = 19,
CannotDeleteFile = 20,
BuildIndexError = 21,
IllegalNLIST = 22,
IllegalMetricType = 23,
OutOfMemory = 24,
IndexNotExist = 25,
DDRequestRace = 1000,
ErrorCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(),
ErrorCode_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max()
};
bool ErrorCode_IsValid(int value);
constexpr ErrorCode ErrorCode_MIN = ERROR_CODE_SUCCESS;
constexpr ErrorCode ErrorCode_MAX = ERROR_CODE_DD_REQUEST_RACE;
constexpr ErrorCode ErrorCode_MIN = Success;
constexpr ErrorCode ErrorCode_MAX = DDRequestRace;
constexpr int ErrorCode_ARRAYSIZE = ErrorCode_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ErrorCode_descriptor();
@ -202,7 +202,7 @@ inline bool SegmentState_Parse(
SegmentState_descriptor(), name, value);
}
enum MsgType : int {
None = 0,
UnSpecific = 0,
CreateCollection = 100,
DropCollection = 101,
HasCollection = 102,
@ -244,7 +244,7 @@ enum MsgType : int {
MsgType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max()
};
bool MsgType_IsValid(int value);
constexpr MsgType MsgType_MIN = None;
constexpr MsgType MsgType_MIN = UnSpecific;
constexpr MsgType MsgType_MAX = SegmentFlushDone;
constexpr int MsgType_ARRAYSIZE = MsgType_MAX + 1;

View File

@ -95,7 +95,7 @@ func (node *DataNode) Init() error {
req := &datapb.RegisterNodeRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_None,
MsgType: commonpb.MsgType_UnSpecific,
SourceID: node.NodeID,
},
Address: &commonpb.Address{
@ -161,7 +161,7 @@ func (node *DataNode) UpdateStateCode(code internalpb2.StateCode) {
func (node *DataNode) WatchDmChannels(ctx context.Context, in *datapb.WatchDmChannelRequest) (*commonpb.Status, error) {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
}
switch {
@ -176,7 +176,7 @@ func (node *DataNode) WatchDmChannels(ctx context.Context, in *datapb.WatchDmCha
default:
Params.InsertChannelNames = in.GetChannelNames()
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
status.ErrorCode = commonpb.ErrorCode_Success
node.watchDm <- struct{}{}
return status, nil
}
@ -191,7 +191,7 @@ func (node *DataNode) GetComponentStates(ctx context.Context) (*internalpb2.Comp
StateCode: node.State.Load().(internalpb2.StateCode),
},
SubcomponentStates: make([]*internalpb2.ComponentInfo, 0),
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
}
return states, nil
}
@ -228,7 +228,7 @@ func (node *DataNode) Stop() error {
func (node *DataNode) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: "",
@ -238,7 +238,7 @@ func (node *DataNode) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringR
func (node *DataNode) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: "",

View File

@ -449,7 +449,7 @@ func (m *MasterServiceFactory) GetComponentStates(ctx context.Context) (*interna
State: &internalpb2.ComponentInfo{},
SubcomponentStates: make([]*internalpb2.ComponentInfo, 0),
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}

View File

@ -77,11 +77,11 @@ func newMockDataNodeClient() *mockDataNodeClient {
}
func (c *mockDataNodeClient) WatchDmChannels(ctx context.Context, in *datapb.WatchDmChannelRequest) (*commonpb.Status, error) {
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}, nil
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}, nil
}
func (c *mockDataNodeClient) FlushSegments(ctx context.Context, in *datapb.FlushSegRequest) (*commonpb.Status, error) {
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}, nil
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}, nil
}
func (c *mockDataNodeClient) Stop() error {

View File

@ -412,7 +412,7 @@ func (s *Server) GetComponentStates(ctx context.Context) (*internalpb2.Component
StateCode: s.state.Load().(internalpb2.StateCode),
},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
dataNodeStates, err := s.cluster.GetDataNodeStates(ctx)
@ -421,14 +421,14 @@ func (s *Server) GetComponentStates(ctx context.Context) (*internalpb2.Component
return resp, nil
}
resp.SubcomponentStates = dataNodeStates
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
return resp, nil
}
func (s *Server) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: Params.TimeTickChannelName,
}, nil
@ -437,7 +437,7 @@ func (s *Server) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringRespon
func (s *Server) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: Params.StatisticsChannelName,
}, nil
@ -446,7 +446,7 @@ func (s *Server) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResp
func (s *Server) RegisterNode(ctx context.Context, req *datapb.RegisterNodeRequest) (*datapb.RegisterNodeResponse, error) {
ret := &datapb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
log.Debug("DataService: RegisterNode:", zap.String("IP", req.Address.Ip), zap.Int64("Port", req.Address.Port))
@ -465,7 +465,7 @@ func (s *Server) RegisterNode(ctx context.Context, req *datapb.RegisterNodeReque
}
s.ddChannelName = resp.Value
}
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_Success
ret.InitParams = &internalpb2.InitParams{
NodeID: Params.NodeID,
StartParams: []*commonpb.KeyValuePair{
@ -501,25 +501,25 @@ func (s *Server) newDataNode(ip string, port int64, id UniqueID) (*dataNode, err
func (s *Server) Flush(ctx context.Context, req *datapb.FlushRequest) (*commonpb.Status, error) {
if !s.checkStateIsHealthy() {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "server is initializing",
}, nil
}
s.segAllocator.SealAllSegments(req.CollectionID)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
func (s *Server) AssignSegmentID(ctx context.Context, req *datapb.AssignSegIDRequest) (*datapb.AssignSegIDResponse, error) {
resp := &datapb.AssignSegIDResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
SegIDAssignments: make([]*datapb.SegIDAssignment, 0),
}
if !s.checkStateIsHealthy() {
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
resp.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
resp.Status.Reason = "server is initializing"
return resp, nil
}
@ -532,7 +532,7 @@ func (s *Server) AssignSegmentID(ctx context.Context, req *datapb.AssignSegIDReq
}
result := &datapb.SegIDAssignment{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
segmentID, retCount, expireTs, err := s.segAllocator.AllocSegment(r.CollectionID, r.PartitionID, r.ChannelName, int(r.Count))
@ -560,7 +560,7 @@ func (s *Server) AssignSegmentID(ctx context.Context, req *datapb.AssignSegIDReq
}
}
result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
result.Status.ErrorCode = commonpb.ErrorCode_Success
result.CollectionID = r.CollectionID
result.SegID = segmentID
result.PartitionID = r.PartitionID
@ -633,7 +633,7 @@ func (s *Server) openNewSegment(collectionID UniqueID, partitionID UniqueID, cha
func (s *Server) ShowSegments(ctx context.Context, req *datapb.ShowSegmentRequest) (*datapb.ShowSegmentResponse, error) {
resp := &datapb.ShowSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
if !s.checkStateIsHealthy() {
@ -641,7 +641,7 @@ func (s *Server) ShowSegments(ctx context.Context, req *datapb.ShowSegmentReques
return resp, nil
}
ids := s.meta.GetSegmentsOfPartition(req.CollectionID, req.PartitionID)
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.SegmentIDs = ids
return resp, nil
}
@ -649,7 +649,7 @@ func (s *Server) ShowSegments(ctx context.Context, req *datapb.ShowSegmentReques
func (s *Server) GetSegmentStates(ctx context.Context, req *datapb.SegmentStatesRequest) (*datapb.SegmentStatesResponse, error) {
resp := &datapb.SegmentStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
if !s.checkStateIsHealthy() {
@ -664,10 +664,10 @@ func (s *Server) GetSegmentStates(ctx context.Context, req *datapb.SegmentStates
}
segmentInfo, err := s.meta.GetSegment(segmentID)
if err != nil {
state.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
state.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
state.Status.Reason = "get segment states error: " + err.Error()
} else {
state.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
state.Status.ErrorCode = commonpb.ErrorCode_Success
state.State = segmentInfo.State
state.CreateTime = segmentInfo.OpenTime
state.SealedTime = segmentInfo.SealedTime
@ -677,7 +677,7 @@ func (s *Server) GetSegmentStates(ctx context.Context, req *datapb.SegmentStates
}
resp.States = append(resp.States, state)
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
return resp, nil
}
@ -685,7 +685,7 @@ func (s *Server) GetSegmentStates(ctx context.Context, req *datapb.SegmentStates
func (s *Server) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertBinlogPathRequest) (*datapb.InsertBinlogPathsResponse, error) {
resp := &datapb.InsertBinlogPathsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
p := path.Join(Params.SegmentFlushMetaPath, strconv.FormatInt(req.SegmentID, 10))
@ -706,7 +706,7 @@ func (s *Server) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertBin
fields[i] = field.FieldID
paths[i] = &internalpb2.StringList{Values: field.BinlogPaths}
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.FieldIDs = fields
resp.Paths = paths
return resp, nil
@ -715,7 +715,7 @@ func (s *Server) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertBin
func (s *Server) GetInsertChannels(ctx context.Context, req *datapb.InsertChannelRequest) (*internalpb2.StringList, error) {
return &internalpb2.StringList{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Values: s.insertChannels,
}, nil
@ -724,7 +724,7 @@ func (s *Server) GetInsertChannels(ctx context.Context, req *datapb.InsertChanne
func (s *Server) GetCollectionStatistics(ctx context.Context, req *datapb.CollectionStatsRequest) (*datapb.CollectionStatsResponse, error) {
resp := &datapb.CollectionStatsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
nums, err := s.meta.GetNumRowsOfCollection(req.CollectionID)
@ -732,7 +732,7 @@ func (s *Server) GetCollectionStatistics(ctx context.Context, req *datapb.Collec
resp.Status.Reason = err.Error()
return resp, nil
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.Stats = append(resp.Stats, &commonpb.KeyValuePair{Key: "row_count", Value: strconv.FormatInt(nums, 10)})
return resp, nil
}
@ -745,7 +745,7 @@ func (s *Server) GetPartitionStatistics(ctx context.Context, req *datapb.Partiti
func (s *Server) GetSegmentInfoChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: Params.SegmentInfoChannelName,
}, nil
@ -754,7 +754,7 @@ func (s *Server) GetSegmentInfoChannel(ctx context.Context) (*milvuspb.StringRes
func (s *Server) GetSegmentInfo(ctx context.Context, req *datapb.SegmentInfoRequest) (*datapb.SegmentInfoResponse, error) {
resp := &datapb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
if !s.checkStateIsHealthy() {
@ -770,7 +770,7 @@ func (s *Server) GetSegmentInfo(ctx context.Context, req *datapb.SegmentInfoRequ
}
infos[i] = segmentInfo
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.Infos = infos
return resp, nil
}

View File

@ -19,11 +19,11 @@ func VerifyResponse(response interface{}, err error) error {
}
switch resp := response.(type) {
case Response:
if resp.GetStatus().ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.GetStatus().ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.GetStatus().Reason)
}
case *commonpb.Status:
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Reason)
}
default:

View File

@ -238,11 +238,11 @@ func (s *Server) WatchDmChannels(ctx context.Context, in *datapb.WatchDmChannelR
func (s *Server) FlushSegments(ctx context.Context, in *datapb.FlushSegRequest) (*commonpb.Status, error) {
if s.datanode.State.Load().(internalpb2.StateCode) != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "DataNode isn't healthy.",
}, errors.New("DataNode is not ready yet")
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, s.datanode.FlushSegments(ctx, in)
}

View File

@ -59,7 +59,7 @@ func (c *Client) GetComponentStates(ctx context.Context) (*internalpb2.Component
func (c *Client) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}
@ -67,7 +67,7 @@ func (c *Client) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringRespon
func (c *Client) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}

View File

@ -200,7 +200,7 @@ func TestGrpcService(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, len(createCollectionArray), 1)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, createCollectionArray[0].Base.MsgType, commonpb.MsgType_CreateCollection)
assert.Equal(t, createCollectionArray[0].CollectionName, "testColl")
@ -209,7 +209,7 @@ func TestGrpcService(t *testing.T) {
req.Base.SourceID = 101
status, err = cli.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
req.Base.MsgID = 102
req.Base.Timestamp = 102
@ -217,7 +217,7 @@ func TestGrpcService(t *testing.T) {
req.CollectionName = "testColl-again"
status, err = cli.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
schema.Name = req.CollectionName
sbf, err = proto.Marshal(&schema)
@ -228,7 +228,7 @@ func TestGrpcService(t *testing.T) {
req.Base.SourceID = 103
status, err = cli.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(createCollectionArray), 2)
assert.Equal(t, createCollectionArray[1].Base.MsgType, commonpb.MsgType_CreateCollection)
assert.Equal(t, createCollectionArray[1].CollectionName, "testColl-again")
@ -244,7 +244,7 @@ func TestGrpcService(t *testing.T) {
req.Base.SourceID = 103
status, err = cli.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
matched, err := regexp.MatchString("input timestamp = [0-9]+, last dd time stamp = [0-9]+", status.Reason)
assert.Nil(t, err)
assert.True(t, matched)
@ -263,7 +263,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, true)
req = &milvuspb.HasCollectionRequest{
@ -278,7 +278,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err = cli.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, false)
// test time stamp go back
@ -294,7 +294,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err = cli.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, false)
})
@ -313,7 +313,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.DescribeCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Schema.Name, "testColl")
assert.Equal(t, rsp.CollectionID, collMeta.ID)
})
@ -330,7 +330,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.ShowCollections(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.ElementsMatch(t, rsp.CollectionNames, []string{"testColl", "testColl-again"})
assert.Equal(t, len(rsp.CollectionNames), 2)
})
@ -349,7 +349,7 @@ func TestGrpcService(t *testing.T) {
}
status, err := cli.CreatePartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
collMeta, err := core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 2)
@ -373,7 +373,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.HasPartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, true)
})
@ -393,7 +393,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.ShowPartitions(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.PartitionNames), 2)
assert.Equal(t, len(rsp.PartitionIDs), 2)
})
@ -428,7 +428,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.ShowSegments(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.SegmentIDs[0], int64(1000))
assert.Equal(t, len(rsp.SegmentIDs), 1)
})
@ -456,7 +456,7 @@ func TestGrpcService(t *testing.T) {
assert.Equal(t, len(collMeta.FieldIndexes), 0)
rsp, err := cli.CreateIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
collMeta, err = core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.FieldIndexes), 1)
@ -469,7 +469,7 @@ func TestGrpcService(t *testing.T) {
req.FieldName = "no field"
rsp, err = cli.CreateIndex(ctx, req)
assert.Nil(t, err)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
})
t.Run("describe segment", func(t *testing.T) {
@ -488,7 +488,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.DescribeSegment(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
t.Logf("index id = %d", rsp.IndexID)
})
@ -507,7 +507,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.DescribeIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.IndexDescriptions), 1)
assert.Equal(t, rsp.IndexDescriptions[0].IndexName, cms.Params.DefaultIndexName)
})
@ -546,7 +546,7 @@ func TestGrpcService(t *testing.T) {
}
rsp, err := cli.DescribeIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.IndexDescriptions), 1)
assert.Equal(t, rsp.IndexDescriptions[0].IndexName, cms.Params.DefaultIndexName)
@ -570,7 +570,7 @@ func TestGrpcService(t *testing.T) {
assert.Equal(t, len(idx), 1)
rsp, err := cli.DropIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
dropIDLock.Lock()
assert.Equal(t, len(dropID), 1)
@ -593,7 +593,7 @@ func TestGrpcService(t *testing.T) {
}
status, err := cli.DropPartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
collMeta, err := core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 1)
@ -617,8 +617,8 @@ func TestGrpcService(t *testing.T) {
status, err := cli.DropCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, len(dropCollectionArray), 1)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, dropCollectionArray[0].Base.MsgType, commonpb.MsgType_DropCollection)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, dropCollectionArray[0].CollectionName, "testColl")
assert.Equal(t, len(collectionMetaCache), 1)
assert.Equal(t, collectionMetaCache[0], "testColl")
@ -636,7 +636,7 @@ func TestGrpcService(t *testing.T) {
status, err = cli.DropCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, len(dropCollectionArray), 1)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
})
err = cli.Stop()

View File

@ -69,7 +69,7 @@ func (c *Client) GetComponentStates(ctx context.Context) (*internalpb2.Component
func (c *Client) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}

View File

@ -91,7 +91,7 @@ func (m *MasterServiceMock) DescribeSegment(in *milvuspb.DescribeSegmentRequest)
}
rsp := &milvuspb.DescribeSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
IndexID: in.SegmentID, // use index id as segment id
BuildID: in.SegmentID,
@ -169,13 +169,13 @@ func (index *IndexServiceMock) GetIndexFilePaths(req *indexpb.IndexFilePathsRequ
indexPathInfo := make([]*indexpb.IndexFilePathInfo, 1)
indexPathInfo[0] = &indexpb.IndexFilePathInfo{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
IndexFilePaths: []string{indexPaths1, indexPaths2},
}
rsp := &indexpb.IndexFilePathsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
FilePaths: indexPathInfo,
}
@ -187,7 +187,7 @@ type queryServiceMock struct{}
func (q *queryServiceMock) RegisterNode(req *querypb.RegisterNodeRequest) (*querypb.RegisterNodeResponse, error) {
return &querypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
InitParams: &internalPb.InitParams{
NodeID: int64(0),

View File

@ -306,7 +306,7 @@ func (s *Server) GetTimeTickChannel(ctx context.Context, in *commonpb.Empty) (*m
}
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: channel,
}, nil
@ -320,7 +320,7 @@ func (s *Server) GetStatsChannel(ctx context.Context, in *commonpb.Empty) (*milv
}
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: channel,
}, nil

View File

@ -86,7 +86,7 @@ func (i *IndexNode) Init() error {
return err2
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason)
}
@ -175,12 +175,12 @@ func (i *IndexNode) BuildIndex(ctx context.Context, request *indexpb.BuildIndexC
}
ret := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
err := i.sched.IndexBuildQueue.Enqueue(t)
if err != nil {
ret.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.ErrorCode = commonpb.ErrorCode_UnexpectedError
ret.Reason = err.Error()
return ret, nil
}
@ -191,7 +191,7 @@ func (i *IndexNode) BuildIndex(ctx context.Context, request *indexpb.BuildIndexC
func (i *IndexNode) DropIndex(ctx context.Context, request *indexpb.DropIndexRequest) (*commonpb.Status, error) {
i.sched.IndexBuildQueue.tryToRemoveUselessIndexBuildTask(request.IndexID)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -218,7 +218,7 @@ func (i *IndexNode) GetComponentStates(ctx context.Context) (*internalpb2.Compon
State: stateInfo,
SubcomponentStates: nil, // todo add subcomponents states
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}
return ret, nil
@ -227,7 +227,7 @@ func (i *IndexNode) GetComponentStates(ctx context.Context) (*internalpb2.Compon
func (i *IndexNode) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}
@ -235,7 +235,7 @@ func (i *IndexNode) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringRes
func (i *IndexNode) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}, nil
}

View File

@ -122,14 +122,14 @@ func (it *IndexBuildTask) PostExecute(ctx context.Context) error {
nty := &indexpb.BuildIndexNotification{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
IndexBuildID: it.cmd.IndexBuildID,
NodeID: it.nodeID,
IndexFilePaths: it.savePaths,
}
if it.err != nil {
nty.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR
nty.Status.ErrorCode = commonpb.ErrorCode_BuildIndexError
}
ctx = context.TODO()
@ -139,7 +139,7 @@ func (it *IndexBuildTask) PostExecute(ctx context.Context) error {
return err
}
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_Success {
err = errors.New(resp.Reason)
}
log.Debug("indexnode", zap.String("[IndexBuildTask][PostExecute] err", err.Error()))

View File

@ -165,7 +165,7 @@ func (i *IndexService) GetComponentStates(ctx context.Context) (*internalpb2.Com
State: stateInfo,
SubcomponentStates: nil, // todo add subcomponents states
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}
return ret, nil
@ -174,7 +174,7 @@ func (i *IndexService) GetComponentStates(ctx context.Context) (*internalpb2.Com
func (i *IndexService) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: "",
@ -184,7 +184,7 @@ func (i *IndexService) GetTimeTickChannel(ctx context.Context) (*milvuspb.String
func (i *IndexService) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: "",
@ -195,7 +195,7 @@ func (i *IndexService) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRe
fmt.Println("builder building index ..., indexName = ", req.IndexName, "indexID = ", req.IndexID, "dataPath = ", req.DataPaths)
ret := &indexpb.BuildIndexResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
t := &IndexAddTask{
@ -230,18 +230,18 @@ func (i *IndexService) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRe
err := fn()
if err != nil {
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
ret.Status.Reason = err.Error()
return ret, nil
}
err = t.WaitToFinish()
if err != nil {
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
ret.Status.Reason = err.Error()
return ret, nil
}
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_Success
ret.IndexBuildID = t.indexBuildID
return ret, nil
}
@ -257,7 +257,7 @@ func (i *IndexService) GetIndexStates(ctx context.Context, req *indexpb.IndexSta
}
ret := &indexpb.IndexStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
States: indexStates,
}
@ -270,7 +270,7 @@ func (i *IndexService) DropIndex(ctx context.Context, req *indexpb.DropIndexRequ
err := i.metaTable.MarkIndexAsDeleted(req.IndexID)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -289,7 +289,7 @@ func (i *IndexService) DropIndex(ctx context.Context, req *indexpb.DropIndexRequ
}()
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -306,7 +306,7 @@ func (i *IndexService) GetIndexFilePaths(ctx context.Context, req *indexpb.Index
ret := &indexpb.IndexFilePathsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
FilePaths: indexPaths,
}
@ -315,11 +315,11 @@ func (i *IndexService) GetIndexFilePaths(ctx context.Context, req *indexpb.Index
func (i *IndexService) NotifyBuildIndex(ctx context.Context, nty *indexpb.BuildIndexNotification) (*commonpb.Status, error) {
ret := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
log.Debug("indexservice", zap.String("[IndexService][NotifyBuildIndex]", nty.String()))
if err := i.metaTable.NotifyBuildIndex(nty); err != nil {
ret.ErrorCode = commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR
ret.ErrorCode = commonpb.ErrorCode_BuildIndexError
ret.Reason = err.Error()
log.Debug("indexservice", zap.String("[IndexService][NotifyBuildIndex][metaTable][NotifyBuildIndex]", err.Error()))
}

View File

@ -114,7 +114,7 @@ func (mt *metaTable) NotifyBuildIndex(nty *indexpb.BuildIndexNotification) error
return fmt.Errorf("index not exists with ID = %d", indexBuildID)
}
if nty.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if nty.Status.ErrorCode != commonpb.ErrorCode_Success {
meta.State = commonpb.IndexState_INDEX_STATE_FAILED
meta.FailReason = nty.Status.Reason
} else {

View File

@ -58,7 +58,7 @@ func (i *IndexService) prepareNodeInitParams() []*commonpb.KeyValuePair {
func (i *IndexService) RegisterNode(ctx context.Context, req *indexpb.RegisterNodeRequest) (*indexpb.RegisterNodeResponse, error) {
ret := &indexpb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
@ -74,7 +74,7 @@ func (i *IndexService) RegisterNode(ctx context.Context, req *indexpb.RegisterNo
return ret, nil
}
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_Success
params := i.prepareNodeInitParams()
ret.InitParams = &internalpb2.InitParams{
NodeID: nodeID,

View File

@ -122,7 +122,7 @@ func (it *IndexAddTask) Execute(ctx context.Context) error {
return err
}
log.Debug("indexservice", zap.String("build index finish err", err.Error()))
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Reason)
}
it.nodeClients.IncPriority(it.buildClientNodeID, 1)

View File

@ -615,7 +615,7 @@ func (c *Core) SetProxyService(ctx context.Context, s types.ProxyService) error
if status == nil {
return errors.New("invalidate collection metacache resp is nil")
}
if status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(status.Reason)
}
return nil
@ -648,7 +648,7 @@ func (c *Core) SetDataService(ctx context.Context, s types.DataService) error {
if err != nil {
return nil, err
}
if binlog.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if binlog.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, fmt.Errorf("GetInsertBinlogPaths from data service failed, error = %s", binlog.Status.Reason)
}
for i := range binlog.FieldIDs {
@ -676,7 +676,7 @@ func (c *Core) SetDataService(ctx context.Context, s types.DataService) error {
if err != nil {
return 0, err
}
if segInfo.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if segInfo.Status.ErrorCode != commonpb.ErrorCode_Success {
return 0, fmt.Errorf("GetSegmentInfo from data service failed, error = %s", segInfo.Status.Reason)
}
if len(segInfo.Infos) != 1 {
@ -704,7 +704,7 @@ func (c *Core) SetIndexService(ctx context.Context, s types.IndexService) error
if err != nil {
return 0, err
}
if rsp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if rsp.Status.ErrorCode != commonpb.ErrorCode_Success {
return 0, fmt.Errorf("BuildIndex from index service failed, error = %s", rsp.Status.Reason)
}
return rsp.IndexBuildID, nil
@ -717,7 +717,7 @@ func (c *Core) SetIndexService(ctx context.Context, s types.IndexService) error
if err != nil {
return err
}
if rsp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if rsp.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(rsp.Reason)
}
return nil
@ -742,7 +742,7 @@ func (c *Core) SetQueryService(ctx context.Context, s types.QueryService) error
if err != nil {
return err
}
if rsp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if rsp.ErrorCode != commonpb.ErrorCode_Success {
return fmt.Errorf("ReleaseCollection from query service failed, error = %s", rsp.Reason)
}
return nil
@ -822,7 +822,7 @@ func (c *Core) GetComponentStates(ctx context.Context) (*internalpb2.ComponentSt
ExtraInfo: nil,
},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
SubcomponentStates: []*internalpb2.ComponentInfo{
@ -839,7 +839,7 @@ func (c *Core) GetComponentStates(ctx context.Context) (*internalpb2.ComponentSt
func (c *Core) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: Params.TimeTickChannel,
@ -849,7 +849,7 @@ func (c *Core) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse
func (c *Core) GetDdChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: Params.DdChannel,
@ -859,7 +859,7 @@ func (c *Core) GetDdChannel(ctx context.Context) (*milvuspb.StringResponse, erro
func (c *Core) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: Params.StatisticsChannel,
@ -870,7 +870,7 @@ func (c *Core) CreateCollection(ctx context.Context, in *milvuspb.CreateCollecti
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -887,13 +887,13 @@ func (c *Core) CreateCollection(ctx context.Context, in *milvuspb.CreateCollecti
if err != nil {
log.Debug("CreateCollection failed", zap.String("name", in.CollectionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "Create collection failed: " + err.Error(),
}, nil
}
log.Debug("CreateCollection Success", zap.String("name", in.CollectionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -902,7 +902,7 @@ func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRe
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -919,13 +919,13 @@ func (c *Core) DropCollection(ctx context.Context, in *milvuspb.DropCollectionRe
if err != nil {
log.Debug("DropCollection Failed", zap.String("name", in.CollectionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "Drop collection failed: " + err.Error(),
}, nil
}
log.Debug("DropCollection Success", zap.String("name", in.CollectionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -935,7 +935,7 @@ func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequ
if code != internalpb2.StateCode_Healthy {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
Value: false,
@ -956,7 +956,7 @@ func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequ
log.Debug("HasCollection Failed", zap.String("name", in.CollectionName))
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "Has collection failed: " + err.Error(),
},
Value: false,
@ -965,7 +965,7 @@ func (c *Core) HasCollection(ctx context.Context, in *milvuspb.HasCollectionRequ
log.Debug("HasCollection Success", zap.String("name", in.CollectionName))
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: t.HasCollection,
@ -977,7 +977,7 @@ func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeColl
if code != internalpb2.StateCode_Healthy {
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
Schema: nil,
@ -999,7 +999,7 @@ func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeColl
log.Debug("DescribeCollection Failed", zap.String("name", in.CollectionName))
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "describe collection failed: " + err.Error(),
},
Schema: nil,
@ -1007,7 +1007,7 @@ func (c *Core) DescribeCollection(ctx context.Context, in *milvuspb.DescribeColl
}
log.Debug("DescribeCollection Success", zap.String("name", in.CollectionName))
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
return t.Rsp, nil
@ -1018,7 +1018,7 @@ func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollectionR
if code != internalpb2.StateCode_Healthy {
return &milvuspb.ShowCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
CollectionNames: nil,
@ -1042,14 +1042,14 @@ func (c *Core) ShowCollections(ctx context.Context, in *milvuspb.ShowCollectionR
return &milvuspb.ShowCollectionResponse{
CollectionNames: nil,
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "ShowCollections failed: " + err.Error(),
},
}, nil
}
log.Debug("ShowCollections Success", zap.String("dbname", in.DbName), zap.Strings("collection names", t.Rsp.CollectionNames))
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
return t.Rsp, nil
@ -1059,7 +1059,7 @@ func (c *Core) CreatePartition(ctx context.Context, in *milvuspb.CreatePartition
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -1076,13 +1076,13 @@ func (c *Core) CreatePartition(ctx context.Context, in *milvuspb.CreatePartition
if err != nil {
log.Debug("CreatePartition Failed", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "create partition failed: " + err.Error(),
}, nil
}
log.Debug("CreatePartition Success", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -1091,7 +1091,7 @@ func (c *Core) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequ
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -1108,13 +1108,13 @@ func (c *Core) DropPartition(ctx context.Context, in *milvuspb.DropPartitionRequ
if err != nil {
log.Debug("DropPartition Failed", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "DropPartition failed: " + err.Error(),
}, nil
}
log.Debug("DropPartition Success", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -1124,7 +1124,7 @@ func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionReques
if code != internalpb2.StateCode_Healthy {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
Value: false,
@ -1145,7 +1145,7 @@ func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionReques
log.Debug("HasPartition Failed", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "HasPartition failed: " + err.Error(),
},
Value: false,
@ -1154,7 +1154,7 @@ func (c *Core) HasPartition(ctx context.Context, in *milvuspb.HasPartitionReques
log.Debug("HasPartition Success", zap.String("collection name", in.CollectionName), zap.String("partition name", in.PartitionName))
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: t.HasPartition,
@ -1166,7 +1166,7 @@ func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionReq
if code != internalpb2.StateCode_Healthy {
return &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
PartitionNames: nil,
@ -1191,14 +1191,14 @@ func (c *Core) ShowPartitions(ctx context.Context, in *milvuspb.ShowPartitionReq
return &milvuspb.ShowPartitionResponse{
PartitionNames: nil,
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "ShowPartitions failed: " + err.Error(),
},
}, nil
}
log.Debug("ShowPartitions Success", zap.String("collection name", in.CollectionName), zap.Strings("partition names", t.Rsp.PartitionNames), zap.Int64s("partition ids", t.Rsp.PartitionIDs))
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
return t.Rsp, nil
@ -1208,7 +1208,7 @@ func (c *Core) CreateIndex(ctx context.Context, in *milvuspb.CreateIndexRequest)
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -1225,13 +1225,13 @@ func (c *Core) CreateIndex(ctx context.Context, in *milvuspb.CreateIndexRequest)
if err != nil {
log.Debug("CreateIndex Failed", zap.String("collection name", in.CollectionName), zap.String("field name", in.FieldName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "CreateIndex failed, error = " + err.Error(),
}, nil
}
log.Debug("CreateIndex Success", zap.String("collection name", in.CollectionName), zap.String("field name", in.FieldName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -1241,7 +1241,7 @@ func (c *Core) DescribeIndex(ctx context.Context, in *milvuspb.DescribeIndexRequ
if code != internalpb2.StateCode_Healthy {
return &milvuspb.DescribeIndexResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
IndexDescriptions: nil,
@ -1264,7 +1264,7 @@ func (c *Core) DescribeIndex(ctx context.Context, in *milvuspb.DescribeIndexRequ
if err != nil {
return &milvuspb.DescribeIndexResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "DescribeIndex failed, error = " + err.Error(),
},
IndexDescriptions: nil,
@ -1277,12 +1277,12 @@ func (c *Core) DescribeIndex(ctx context.Context, in *milvuspb.DescribeIndexRequ
log.Debug("DescribeIndex Success", zap.String("collection name", in.CollectionName), zap.String("field name", in.FieldName), zap.Strings("index names", idxNames))
if len(t.Rsp.IndexDescriptions) == 0 {
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_INDEX_NOT_EXIST,
ErrorCode: commonpb.ErrorCode_IndexNotExist,
Reason: "index not exist",
}
} else {
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
}
@ -1293,7 +1293,7 @@ func (c *Core) DropIndex(ctx context.Context, in *milvuspb.DropIndexRequest) (*c
code := c.stateCode.Load().(internalpb2.StateCode)
if code != internalpb2.StateCode_Healthy {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
}, nil
}
@ -1310,13 +1310,13 @@ func (c *Core) DropIndex(ctx context.Context, in *milvuspb.DropIndexRequest) (*c
if err != nil {
log.Debug("DropIndex Failed", zap.String("collection name", in.CollectionName), zap.String("field name", in.FieldName), zap.String("index name", in.IndexName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "DropIndex failed, error = " + err.Error(),
}, nil
}
log.Debug("DropIndex Success", zap.String("collection name", in.CollectionName), zap.String("field name", in.FieldName), zap.String("index name", in.IndexName))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -1326,7 +1326,7 @@ func (c *Core) DescribeSegment(ctx context.Context, in *milvuspb.DescribeSegment
if code != internalpb2.StateCode_Healthy {
return &milvuspb.DescribeSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
IndexID: 0,
@ -1350,7 +1350,7 @@ func (c *Core) DescribeSegment(ctx context.Context, in *milvuspb.DescribeSegment
log.Debug("DescribeSegment Failed", zap.Int64("collection id", in.CollectionID), zap.Int64("segment id", in.SegmentID))
return &milvuspb.DescribeSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "DescribeSegment failed, error = " + err.Error(),
},
IndexID: 0,
@ -1358,7 +1358,7 @@ func (c *Core) DescribeSegment(ctx context.Context, in *milvuspb.DescribeSegment
}
log.Debug("DescribeSegment Success", zap.Int64("collection id", in.CollectionID), zap.Int64("segment id", in.SegmentID))
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
return t.Rsp, nil
@ -1369,7 +1369,7 @@ func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentRequest
if code != internalpb2.StateCode_Healthy {
return &milvuspb.ShowSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: fmt.Sprintf("state code = %s", internalpb2.StateCode_name[int32(code)]),
},
SegmentIDs: nil,
@ -1392,7 +1392,7 @@ func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentRequest
if err != nil {
return &milvuspb.ShowSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "ShowSegments failed, error: " + err.Error(),
},
SegmentIDs: nil,
@ -1400,7 +1400,7 @@ func (c *Core) ShowSegments(ctx context.Context, in *milvuspb.ShowSegmentRequest
}
log.Debug("ShowSegments Success", zap.Int64("collection id", in.CollectionID), zap.Int64("partition id", in.PartitionID), zap.Int64s("segments ids", t.Rsp.SegmentIDs))
t.Rsp.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}
return t.Rsp, nil
@ -1411,7 +1411,7 @@ func (c *Core) AllocTimestamp(ctx context.Context, in *masterpb.TsoRequest) (*ma
if err != nil {
return &masterpb.TsoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "AllocTimestamp failed: " + err.Error(),
},
Timestamp: 0,
@ -1421,7 +1421,7 @@ func (c *Core) AllocTimestamp(ctx context.Context, in *masterpb.TsoRequest) (*ma
// log.Printf("AllocTimestamp : %d", ts)
return &masterpb.TsoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Timestamp: ts,
@ -1434,7 +1434,7 @@ func (c *Core) AllocID(ctx context.Context, in *masterpb.IDRequest) (*masterpb.I
if err != nil {
return &masterpb.IDResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "AllocID failed: " + err.Error(),
},
ID: 0,
@ -1444,7 +1444,7 @@ func (c *Core) AllocID(ctx context.Context, in *masterpb.IDRequest) (*masterpb.I
log.Debug("AllocID", zap.Int64("id start", start), zap.Uint32("count", in.Count))
return &masterpb.IDResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
ID: start,

View File

@ -34,7 +34,7 @@ type proxyMock struct {
func (p *proxyMock) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: fmt.Sprintf("proxy-time-tick-%d", p.randVal),
}, nil
@ -44,7 +44,7 @@ func (p *proxyMock) InvalidateCollectionMetaCache(ctx context.Context, request *
defer p.mutex.Unlock()
p.collArray = append(p.collArray, request.CollectionName)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
func (p *proxyMock) GetCollArray() []string {
@ -65,7 +65,7 @@ func (d *dataMock) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertB
FieldIDs: []int64{},
Paths: []*internalpb2.StringList{},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
}
@ -74,7 +74,7 @@ func (d *dataMock) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertB
path := &internalpb2.StringList{
Values: []string{fmt.Sprintf("file0-%d", i), fmt.Sprintf("file1-%d", i), fmt.Sprintf("file2-%d", i)},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
}
@ -86,7 +86,7 @@ func (d *dataMock) GetInsertBinlogPaths(ctx context.Context, req *datapb.InsertB
func (d *dataMock) GetSegmentInfo(ctx context.Context, req *datapb.SegmentInfoRequest) (*datapb.SegmentInfoResponse, error) {
return &datapb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Infos: []*datapb.SegmentInfo{
@ -109,7 +109,7 @@ func (q *queryMock) ReleaseCollection(ctx context.Context, req *querypb.ReleaseC
defer q.mutex.Unlock()
q.collID = append(q.collID, req.CollectionID)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -117,7 +117,7 @@ func (q *queryMock) ReleaseCollection(ctx context.Context, req *querypb.ReleaseC
func (d *dataMock) GetSegmentInfoChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: fmt.Sprintf("segment-info-channel-%d", d.randVal),
}, nil
@ -140,7 +140,7 @@ func (idx *indexMock) BuildIndex(ctx context.Context, req *indexpb.BuildIndexReq
idx.idxID = append(idx.idxID, req.IndexID)
return &indexpb.BuildIndexResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
IndexBuildID: idx.idxBuildID[len(idx.idxBuildID)-1],
@ -152,7 +152,7 @@ func (idx *indexMock) DropIndex(ctx context.Context, req *indexpb.DropIndexReque
defer idx.mutex.Unlock()
idx.idxDropID = append(idx.idxDropID, req.IndexID)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -329,7 +329,7 @@ func TestMasterService(t *testing.T) {
}
status, err := core.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
msg, ok := <-ddStream.Chan()
assert.True(t, ok)
@ -361,7 +361,7 @@ func TestMasterService(t *testing.T) {
req.Base.SourceID = 101
status, err = core.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
req.Base.MsgID = 102
req.Base.Timestamp = 102
@ -369,7 +369,7 @@ func TestMasterService(t *testing.T) {
req.CollectionName = "testColl-again"
status, err = core.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
schema.Name = req.CollectionName
sbf, err = proto.Marshal(&schema)
@ -380,7 +380,7 @@ func TestMasterService(t *testing.T) {
req.Base.SourceID = 103
status, err = core.CreateCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
msg, ok = <-ddStream.Chan()
assert.True(t, ok)
@ -404,7 +404,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, true)
req = &milvuspb.HasCollectionRequest{
@ -419,7 +419,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err = core.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, false)
// test time stamp go back
@ -435,7 +435,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err = core.HasCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, true)
})
@ -454,7 +454,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.DescribeCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Schema.Name, "testColl")
assert.Equal(t, rsp.CollectionID, collMeta.ID)
@ -472,7 +472,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.ShowCollections(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.ElementsMatch(t, rsp.CollectionNames, []string{"testColl", "testColl-again"})
assert.Equal(t, len(rsp.CollectionNames), 2)
})
@ -492,7 +492,7 @@ func TestMasterService(t *testing.T) {
consumeMsgChan(time.Second, ddStream.Chan())
status, err := core.CreatePartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
collMeta, err := core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 2)
@ -523,7 +523,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.HasPartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.Value, true)
})
@ -543,7 +543,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.ShowPartitions(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.PartitionNames), 2)
assert.Equal(t, len(rsp.PartitionIDs), 2)
})
@ -601,7 +601,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.ShowSegments(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, rsp.SegmentIDs[0], int64(1000))
assert.Equal(t, len(rsp.SegmentIDs), 1)
})
@ -630,7 +630,7 @@ func TestMasterService(t *testing.T) {
rsp, err := core.CreateIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
time.Sleep(time.Second)
files := im.getFileArray()
assert.Equal(t, 3, len(files))
@ -645,7 +645,7 @@ func TestMasterService(t *testing.T) {
req.FieldName = "no field"
rsp, err = core.CreateIndex(ctx, req)
assert.Nil(t, err)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
})
t.Run("describe segment", func(t *testing.T) {
@ -664,7 +664,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.DescribeSegment(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
t.Logf("index id = %d", rsp.IndexID)
})
@ -683,7 +683,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.DescribeIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.IndexDescriptions), 1)
assert.Equal(t, rsp.IndexDescriptions[0].IndexName, Params.DefaultIndexName)
})
@ -703,7 +703,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.DescribeIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_INDEX_NOT_EXIST)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_IndexNotExist)
assert.Equal(t, len(rsp.IndexDescriptions), 0)
})
@ -779,7 +779,7 @@ func TestMasterService(t *testing.T) {
}
rsp, err := core.DescribeIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_Success)
assert.Equal(t, len(rsp.IndexDescriptions), 1)
assert.Equal(t, rsp.IndexDescriptions[0].IndexName, Params.DefaultIndexName)
})
@ -810,7 +810,7 @@ func TestMasterService(t *testing.T) {
rsp, err := core.CreateIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
time.Sleep(time.Second)
collMeta, err = core.MetaTable.GetCollectionByName("testColl")
@ -848,7 +848,7 @@ func TestMasterService(t *testing.T) {
rsp, err := core.DropIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_Success)
im.mutex.Lock()
assert.Equal(t, len(im.idxDropID), 1)
@ -877,7 +877,7 @@ func TestMasterService(t *testing.T) {
dropPartID := collMeta.PartitionIDs[1]
status, err := core.DropPartition(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
collMeta, err = core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 1)
@ -909,7 +909,7 @@ func TestMasterService(t *testing.T) {
assert.Nil(t, err)
status, err := core.DropCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_Success)
msg, ok := <-ddStream.Chan()
assert.True(t, ok)
@ -939,7 +939,7 @@ func TestMasterService(t *testing.T) {
}
status, err = core.DropCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UnexpectedError)
time.Sleep(time.Second)
assert.Zero(t, len(ddStream.Chan()))
collArray = pm.GetCollArray()

View File

@ -111,7 +111,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 1,
SourceID: reqID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
ResultChannelID: "0",
}
searchResultMsg := &msgstream.SearchResultMsg{

View File

@ -104,7 +104,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 1,
SourceID: reqID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
ResultChannelID: "0",
}
searchResultMsg := &msgstream.SearchResultMsg{

View File

@ -4,34 +4,34 @@ package milvus.proto.common;
option go_package="github.com/zilliztech/milvus-distributed/internal/proto/commonpb";
enum ErrorCode {
ERROR_CODE_SUCCESS = 0;
ERROR_CODE_UNEXPECTED_ERROR = 1;
ERROR_CODE_CONNECT_FAILED = 2;
ERROR_CODE_PERMISSION_DENIED = 3;
ERROR_CODE_COLLECTION_NOT_EXISTS = 4;
ERROR_CODE_ILLEGAL_ARGUMENT = 5;
ERROR_CODE_ILLEGAL_DIMENSION = 7;
ERROR_CODE_ILLEGAL_INDEX_TYPE = 8;
ERROR_CODE_ILLEGAL_COLLECTION_NAME = 9;
ERROR_CODE_ILLEGAL_TOPK = 10;
ERROR_CODE_ILLEGAL_ROWRECORD = 11;
ERROR_CODE_ILLEGAL_VECTOR_ID = 12;
ERROR_CODE_ILLEGAL_SEARCH_RESULT = 13;
ERROR_CODE_FILE_NOT_FOUND = 14;
ERROR_CODE_META_FAILED = 15;
ERROR_CODE_CACHE_FAILED = 16;
ERROR_CODE_CANNOT_CREATE_FOLDER = 17;
ERROR_CODE_CANNOT_CREATE_FILE = 18;
ERROR_CODE_CANNOT_DELETE_FOLDER = 19;
ERROR_CODE_CANNOT_DELETE_FILE = 20;
ERROR_CODE_BUILD_INDEX_ERROR = 21;
ERROR_CODE_ILLEGAL_NLIST = 22;
ERROR_CODE_ILLEGAL_METRIC_TYPE = 23;
ERROR_CODE_OUT_OF_MEMORY = 24;
ERROR_CODE_INDEX_NOT_EXIST = 25;
Success = 0;
UnexpectedError = 1;
ConnectFailed = 2;
PermissionDenied = 3;
CollectionNotExists = 4;
IllegalArgument = 5;
IllegalDimension = 7;
IllegalIndexType = 8;
IllegalCollectionName = 9;
IllegalTOPK = 10;
IllegalRowRecord = 11;
IllegalVectorID = 12;
IllegalSearchResult = 13;
FileNotFound = 14;
MetaFailed = 15;
CacheFailed = 16;
CannotCreateFolder = 17;
CannotCreateFile = 18;
CannotDeleteFolder = 19;
CannotDeleteFile = 20;
BuildIndexError = 21;
IllegalNLIST = 22;
IllegalMetricType = 23;
OutOfMemory = 24;
IndexNotExist = 25;
// internal error code.
ERROR_CODE_DD_REQUEST_RACE = 1000;
DDRequestRace = 1000;
}
enum IndexState {
@ -77,7 +77,7 @@ message Address {
}
enum MsgType {
None = 0;
UnSpecific = 0;
/* DEFINITION REQUESTS: COLLECTION */
CreateCollection = 100;
DropCollection = 101;

View File

@ -23,91 +23,91 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
type ErrorCode int32
const (
ErrorCode_ERROR_CODE_SUCCESS ErrorCode = 0
ErrorCode_ERROR_CODE_UNEXPECTED_ERROR ErrorCode = 1
ErrorCode_ERROR_CODE_CONNECT_FAILED ErrorCode = 2
ErrorCode_ERROR_CODE_PERMISSION_DENIED ErrorCode = 3
ErrorCode_ERROR_CODE_COLLECTION_NOT_EXISTS ErrorCode = 4
ErrorCode_ERROR_CODE_ILLEGAL_ARGUMENT ErrorCode = 5
ErrorCode_ERROR_CODE_ILLEGAL_DIMENSION ErrorCode = 7
ErrorCode_ERROR_CODE_ILLEGAL_INDEX_TYPE ErrorCode = 8
ErrorCode_ERROR_CODE_ILLEGAL_COLLECTION_NAME ErrorCode = 9
ErrorCode_ERROR_CODE_ILLEGAL_TOPK ErrorCode = 10
ErrorCode_ERROR_CODE_ILLEGAL_ROWRECORD ErrorCode = 11
ErrorCode_ERROR_CODE_ILLEGAL_VECTOR_ID ErrorCode = 12
ErrorCode_ERROR_CODE_ILLEGAL_SEARCH_RESULT ErrorCode = 13
ErrorCode_ERROR_CODE_FILE_NOT_FOUND ErrorCode = 14
ErrorCode_ERROR_CODE_META_FAILED ErrorCode = 15
ErrorCode_ERROR_CODE_CACHE_FAILED ErrorCode = 16
ErrorCode_ERROR_CODE_CANNOT_CREATE_FOLDER ErrorCode = 17
ErrorCode_ERROR_CODE_CANNOT_CREATE_FILE ErrorCode = 18
ErrorCode_ERROR_CODE_CANNOT_DELETE_FOLDER ErrorCode = 19
ErrorCode_ERROR_CODE_CANNOT_DELETE_FILE ErrorCode = 20
ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR ErrorCode = 21
ErrorCode_ERROR_CODE_ILLEGAL_NLIST ErrorCode = 22
ErrorCode_ERROR_CODE_ILLEGAL_METRIC_TYPE ErrorCode = 23
ErrorCode_ERROR_CODE_OUT_OF_MEMORY ErrorCode = 24
ErrorCode_ERROR_CODE_INDEX_NOT_EXIST ErrorCode = 25
ErrorCode_Success ErrorCode = 0
ErrorCode_UnexpectedError ErrorCode = 1
ErrorCode_ConnectFailed ErrorCode = 2
ErrorCode_PermissionDenied ErrorCode = 3
ErrorCode_CollectionNotExists ErrorCode = 4
ErrorCode_IllegalArgument ErrorCode = 5
ErrorCode_IllegalDimension ErrorCode = 7
ErrorCode_IllegalIndexType ErrorCode = 8
ErrorCode_IllegalCollectionName ErrorCode = 9
ErrorCode_IllegalTOPK ErrorCode = 10
ErrorCode_IllegalRowRecord ErrorCode = 11
ErrorCode_IllegalVectorID ErrorCode = 12
ErrorCode_IllegalSearchResult ErrorCode = 13
ErrorCode_FileNotFound ErrorCode = 14
ErrorCode_MetaFailed ErrorCode = 15
ErrorCode_CacheFailed ErrorCode = 16
ErrorCode_CannotCreateFolder ErrorCode = 17
ErrorCode_CannotCreateFile ErrorCode = 18
ErrorCode_CannotDeleteFolder ErrorCode = 19
ErrorCode_CannotDeleteFile ErrorCode = 20
ErrorCode_BuildIndexError ErrorCode = 21
ErrorCode_IllegalNLIST ErrorCode = 22
ErrorCode_IllegalMetricType ErrorCode = 23
ErrorCode_OutOfMemory ErrorCode = 24
ErrorCode_IndexNotExist ErrorCode = 25
// internal error code.
ErrorCode_ERROR_CODE_DD_REQUEST_RACE ErrorCode = 1000
ErrorCode_DDRequestRace ErrorCode = 1000
)
var ErrorCode_name = map[int32]string{
0: "ERROR_CODE_SUCCESS",
1: "ERROR_CODE_UNEXPECTED_ERROR",
2: "ERROR_CODE_CONNECT_FAILED",
3: "ERROR_CODE_PERMISSION_DENIED",
4: "ERROR_CODE_COLLECTION_NOT_EXISTS",
5: "ERROR_CODE_ILLEGAL_ARGUMENT",
7: "ERROR_CODE_ILLEGAL_DIMENSION",
8: "ERROR_CODE_ILLEGAL_INDEX_TYPE",
9: "ERROR_CODE_ILLEGAL_COLLECTION_NAME",
10: "ERROR_CODE_ILLEGAL_TOPK",
11: "ERROR_CODE_ILLEGAL_ROWRECORD",
12: "ERROR_CODE_ILLEGAL_VECTOR_ID",
13: "ERROR_CODE_ILLEGAL_SEARCH_RESULT",
14: "ERROR_CODE_FILE_NOT_FOUND",
15: "ERROR_CODE_META_FAILED",
16: "ERROR_CODE_CACHE_FAILED",
17: "ERROR_CODE_CANNOT_CREATE_FOLDER",
18: "ERROR_CODE_CANNOT_CREATE_FILE",
19: "ERROR_CODE_CANNOT_DELETE_FOLDER",
20: "ERROR_CODE_CANNOT_DELETE_FILE",
21: "ERROR_CODE_BUILD_INDEX_ERROR",
22: "ERROR_CODE_ILLEGAL_NLIST",
23: "ERROR_CODE_ILLEGAL_METRIC_TYPE",
24: "ERROR_CODE_OUT_OF_MEMORY",
25: "ERROR_CODE_INDEX_NOT_EXIST",
1000: "ERROR_CODE_DD_REQUEST_RACE",
0: "Success",
1: "UnexpectedError",
2: "ConnectFailed",
3: "PermissionDenied",
4: "CollectionNotExists",
5: "IllegalArgument",
7: "IllegalDimension",
8: "IllegalIndexType",
9: "IllegalCollectionName",
10: "IllegalTOPK",
11: "IllegalRowRecord",
12: "IllegalVectorID",
13: "IllegalSearchResult",
14: "FileNotFound",
15: "MetaFailed",
16: "CacheFailed",
17: "CannotCreateFolder",
18: "CannotCreateFile",
19: "CannotDeleteFolder",
20: "CannotDeleteFile",
21: "BuildIndexError",
22: "IllegalNLIST",
23: "IllegalMetricType",
24: "OutOfMemory",
25: "IndexNotExist",
1000: "DDRequestRace",
}
var ErrorCode_value = map[string]int32{
"ERROR_CODE_SUCCESS": 0,
"ERROR_CODE_UNEXPECTED_ERROR": 1,
"ERROR_CODE_CONNECT_FAILED": 2,
"ERROR_CODE_PERMISSION_DENIED": 3,
"ERROR_CODE_COLLECTION_NOT_EXISTS": 4,
"ERROR_CODE_ILLEGAL_ARGUMENT": 5,
"ERROR_CODE_ILLEGAL_DIMENSION": 7,
"ERROR_CODE_ILLEGAL_INDEX_TYPE": 8,
"ERROR_CODE_ILLEGAL_COLLECTION_NAME": 9,
"ERROR_CODE_ILLEGAL_TOPK": 10,
"ERROR_CODE_ILLEGAL_ROWRECORD": 11,
"ERROR_CODE_ILLEGAL_VECTOR_ID": 12,
"ERROR_CODE_ILLEGAL_SEARCH_RESULT": 13,
"ERROR_CODE_FILE_NOT_FOUND": 14,
"ERROR_CODE_META_FAILED": 15,
"ERROR_CODE_CACHE_FAILED": 16,
"ERROR_CODE_CANNOT_CREATE_FOLDER": 17,
"ERROR_CODE_CANNOT_CREATE_FILE": 18,
"ERROR_CODE_CANNOT_DELETE_FOLDER": 19,
"ERROR_CODE_CANNOT_DELETE_FILE": 20,
"ERROR_CODE_BUILD_INDEX_ERROR": 21,
"ERROR_CODE_ILLEGAL_NLIST": 22,
"ERROR_CODE_ILLEGAL_METRIC_TYPE": 23,
"ERROR_CODE_OUT_OF_MEMORY": 24,
"ERROR_CODE_INDEX_NOT_EXIST": 25,
"ERROR_CODE_DD_REQUEST_RACE": 1000,
"Success": 0,
"UnexpectedError": 1,
"ConnectFailed": 2,
"PermissionDenied": 3,
"CollectionNotExists": 4,
"IllegalArgument": 5,
"IllegalDimension": 7,
"IllegalIndexType": 8,
"IllegalCollectionName": 9,
"IllegalTOPK": 10,
"IllegalRowRecord": 11,
"IllegalVectorID": 12,
"IllegalSearchResult": 13,
"FileNotFound": 14,
"MetaFailed": 15,
"CacheFailed": 16,
"CannotCreateFolder": 17,
"CannotCreateFile": 18,
"CannotDeleteFolder": 19,
"CannotDeleteFile": 20,
"BuildIndexError": 21,
"IllegalNLIST": 22,
"IllegalMetricType": 23,
"OutOfMemory": 24,
"IndexNotExist": 25,
"DDRequestRace": 1000,
}
func (x ErrorCode) String() string {
@ -192,7 +192,7 @@ func (SegmentState) EnumDescriptor() ([]byte, []int) {
type MsgType int32
const (
MsgType_None MsgType = 0
MsgType_UnSpecific MsgType = 0
// DEFINITION REQUESTS: COLLECTION
MsgType_CreateCollection MsgType = 100
MsgType_DropCollection MsgType = 101
@ -241,7 +241,7 @@ const (
)
var MsgType_name = map[int32]string{
0: "None",
0: "UnSpecific",
100: "CreateCollection",
101: "DropCollection",
102: "HasCollection",
@ -282,7 +282,7 @@ var MsgType_name = map[int32]string{
}
var MsgType_value = map[string]int32{
"None": 0,
"UnSpecific": 0,
"CreateCollection": 100,
"DropCollection": 101,
"HasCollection": 102,
@ -398,7 +398,7 @@ func (m *Status) GetErrorCode() ErrorCode {
if m != nil {
return m.ErrorCode
}
return ErrorCode_ERROR_CODE_SUCCESS
return ErrorCode_Success
}
func (m *Status) GetReason() string {
@ -580,7 +580,7 @@ func (m *MsgBase) GetMsgType() MsgType {
if m != nil {
return m.MsgType
}
return MsgType_None
return MsgType_UnSpecific
}
func (m *MsgBase) GetMsgID() int64 {
@ -661,85 +661,80 @@ func init() {
func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) }
var fileDescriptor_555bd8c177793206 = []byte{
// 1278 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0xcb, 0x6e, 0xdb, 0x46,
0x17, 0x0e, 0x25, 0xf9, 0xc2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f, 0xdc, 0xa0, 0xf3, 0x18, 0x7d,
0xa6, 0x4a, 0x07, 0xef, 0x8d, 0x58, 0x3c, 0xb6, 0xa2, 0x2e, 0x93, 0xad, 0x1c, 0x7d, 0xae, 0xca,
0xd5, 0xa4, 0xad, 0xe9, 0x6a, 0x5f, 0x24, 0x31, 0x65, 0xef, 0x8f, 0x18, 0x17, 0x86, 0x8e, 0xbe,
0x54, 0xf1, 0x06, 0x40, 0x16, 0xbb, 0x8e, 0x8d, 0xbe, 0x52, 0xa5, 0x8f, 0xd5, 0x30, 0x8c, 0x3a,
0xbe, 0x38, 0xf3, 0xf1, 0x6b, 0x55, 0x1e, 0x44, 0xee, 0xcd, 0xc9, 0x44, 0x7d, 0xa3, 0xe2, 0xcb,
0x80, 0xf2, 0x97, 0x5e, 0x97, 0x17, 0xfc, 0x5b, 0xf5, 0xf8, 0xf8, 0xdd, 0xb7, 0x7b, 0x81, 0x38,
0x1d, 0xb5, 0xe5, 0xcf, 0xf9, 0xe8, 0x79, 0x10, 0x86, 0xc1, 0x73, 0xc1, 0x3a, 0xa7, 0x47, 0xe9,
0x8f, 0xfb, 0x76, 0x37, 0xe0, 0x22, 0x0e, 0xda, 0x23, 0xc1, 0xba, 0x47, 0xc1, 0x40, 0xb0, 0x78,
0xe0, 0x87, 0x47, 0xc9, 0xdf, 0xfc, 0x28, 0xfd, 0x9b, 0x0f, 0xdb, 0xed, 0xc5, 0x24, 0x7e, 0xe3,
0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x3e, 0x02, 0x01, 0xb0, 0x09, 0x00, 0x00,
// 1193 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0xdb, 0x6e, 0x1b, 0x45,
0x18, 0xee, 0xda, 0x4e, 0x9c, 0xfd, 0xed, 0x38, 0x93, 0xc9, 0xb1, 0x34, 0x42, 0x55, 0xae, 0xaa,
0x48, 0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, 0xb0, 0x38, 0x66, 0x4f, 0x14, 0x86, 0xc3, 0xbd, 0xfc, 0xe3, 0xb9,
0x1b, 0x31, 0xa9, 0x04, 0xeb, 0x67, 0x0a, 0xa3, 0x3d, 0x96, 0x2a, 0x14, 0x69, 0x10, 0xef, 0x99,
0xdf, 0x68, 0x2f, 0xff, 0x8d, 0x46, 0xfd, 0xfe, 0xbc, 0x91, 0x5f, 0xfb, 0x37, 0x00, 0x00, 0xff,
0xff, 0x61, 0x0b, 0xb0, 0xaa, 0x70, 0x08, 0x00, 0x00,
}

View File

@ -30,7 +30,7 @@ func (node *ProxyNode) InvalidateCollectionMetaCache(ctx context.Context, reques
collectionName := request.CollectionName
globalMetaCache.RemoveCollection(ctx, collectionName) // no need to return error, though collection may be not cached
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
}, nil
}
@ -49,7 +49,7 @@ func (node *ProxyNode) CreateCollection(ctx context.Context, request *milvuspb.C
err := node.sched.DdQueue.Enqueue(cct)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -57,7 +57,7 @@ func (node *ProxyNode) CreateCollection(ctx context.Context, request *milvuspb.C
err = cct.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -78,7 +78,7 @@ func (node *ProxyNode) DropCollection(ctx context.Context, request *milvuspb.Dro
err := node.sched.DdQueue.Enqueue(dct)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -86,7 +86,7 @@ func (node *ProxyNode) DropCollection(ctx context.Context, request *milvuspb.Dro
err = dct.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -108,7 +108,7 @@ func (node *ProxyNode) HasCollection(ctx context.Context, request *milvuspb.HasC
if err != nil {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -118,7 +118,7 @@ func (node *ProxyNode) HasCollection(ctx context.Context, request *milvuspb.HasC
if err != nil {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -142,7 +142,7 @@ func (node *ProxyNode) LoadCollection(ctx context.Context, request *milvuspb.Loa
err := node.sched.DdQueue.Enqueue(lct)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -150,7 +150,7 @@ func (node *ProxyNode) LoadCollection(ctx context.Context, request *milvuspb.Loa
err = lct.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -171,7 +171,7 @@ func (node *ProxyNode) ReleaseCollection(ctx context.Context, request *milvuspb.
err := node.sched.DdQueue.Enqueue(rct)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -179,7 +179,7 @@ func (node *ProxyNode) ReleaseCollection(ctx context.Context, request *milvuspb.
err = rct.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -201,7 +201,7 @@ func (node *ProxyNode) DescribeCollection(ctx context.Context, request *milvuspb
if err != nil {
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -211,7 +211,7 @@ func (node *ProxyNode) DescribeCollection(ctx context.Context, request *milvuspb
if err != nil {
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -233,7 +233,7 @@ func (node *ProxyNode) GetCollectionStatistics(ctx context.Context, request *mil
if err != nil {
return &milvuspb.CollectionStatsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -243,7 +243,7 @@ func (node *ProxyNode) GetCollectionStatistics(ctx context.Context, request *mil
if err != nil {
return &milvuspb.CollectionStatsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -265,7 +265,7 @@ func (node *ProxyNode) ShowCollections(ctx context.Context, request *milvuspb.Sh
if err != nil {
return &milvuspb.ShowCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -275,7 +275,7 @@ func (node *ProxyNode) ShowCollections(ctx context.Context, request *milvuspb.Sh
if err != nil {
return &milvuspb.ShowCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -297,14 +297,14 @@ func (node *ProxyNode) CreatePartition(ctx context.Context, request *milvuspb.Cr
err := node.sched.DdQueue.Enqueue(cpt)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
err = cpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -325,14 +325,14 @@ func (node *ProxyNode) DropPartition(ctx context.Context, request *milvuspb.Drop
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
err = dpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -354,7 +354,7 @@ func (node *ProxyNode) HasPartition(ctx context.Context, request *milvuspb.HasPa
if err != nil {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
Value: false,
@ -364,7 +364,7 @@ func (node *ProxyNode) HasPartition(ctx context.Context, request *milvuspb.HasPa
if err != nil {
return &milvuspb.BoolResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
Value: false,
@ -386,7 +386,7 @@ func (node *ProxyNode) LoadPartitions(ctx context.Context, request *milvuspb.Loa
err := node.sched.DdQueue.Enqueue(lpt)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -394,7 +394,7 @@ func (node *ProxyNode) LoadPartitions(ctx context.Context, request *milvuspb.Loa
err = lpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -415,7 +415,7 @@ func (node *ProxyNode) ReleasePartitions(ctx context.Context, request *milvuspb.
err := node.sched.DdQueue.Enqueue(rpt)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -423,7 +423,7 @@ func (node *ProxyNode) ReleasePartitions(ctx context.Context, request *milvuspb.
err = rpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -450,7 +450,7 @@ func (node *ProxyNode) ShowPartitions(ctx context.Context, request *milvuspb.Sho
if err != nil {
return &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -460,7 +460,7 @@ func (node *ProxyNode) ShowPartitions(ctx context.Context, request *milvuspb.Sho
if err != nil {
return &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -480,7 +480,7 @@ func (node *ProxyNode) CreateIndex(ctx context.Context, request *milvuspb.Create
err := node.sched.DdQueue.Enqueue(cit)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -488,7 +488,7 @@ func (node *ProxyNode) CreateIndex(ctx context.Context, request *milvuspb.Create
err = cit.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -509,7 +509,7 @@ func (node *ProxyNode) DescribeIndex(ctx context.Context, request *milvuspb.Desc
if err != nil {
return &milvuspb.DescribeIndexResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -539,14 +539,14 @@ func (node *ProxyNode) DropIndex(ctx context.Context, request *milvuspb.DropInde
err := node.sched.DdQueue.Enqueue(dit)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
err = dit.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -566,7 +566,7 @@ func (node *ProxyNode) GetIndexState(ctx context.Context, request *milvuspb.Inde
if err != nil {
return &milvuspb.IndexStateResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -576,7 +576,7 @@ func (node *ProxyNode) GetIndexState(ctx context.Context, request *milvuspb.Inde
if err != nil {
return &milvuspb.IndexStateResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -615,7 +615,7 @@ func (node *ProxyNode) Insert(ctx context.Context, request *milvuspb.InsertReque
if err != nil {
return &milvuspb.InsertResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -625,7 +625,7 @@ func (node *ProxyNode) Insert(ctx context.Context, request *milvuspb.InsertReque
if err != nil {
return &milvuspb.InsertResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -654,7 +654,7 @@ func (node *ProxyNode) Search(ctx context.Context, request *milvuspb.SearchReque
if err != nil {
return &milvuspb.SearchResults{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -664,7 +664,7 @@ func (node *ProxyNode) Search(ctx context.Context, request *milvuspb.SearchReque
if err != nil {
return &milvuspb.SearchResults{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
@ -685,7 +685,7 @@ func (node *ProxyNode) Flush(ctx context.Context, request *milvuspb.FlushRequest
err := node.sched.DdQueue.Enqueue(ft)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -693,7 +693,7 @@ func (node *ProxyNode) Flush(ctx context.Context, request *milvuspb.FlushRequest
err = ft.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -708,7 +708,7 @@ func (node *ProxyNode) GetDdChannel(ctx context.Context, request *commonpb.Empty
func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvuspb.PersistentSegmentInfoRequest) (*milvuspb.PersistentSegmentInfoResponse, error) {
resp := &milvuspb.PersistentSegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
segments, err := node.getSegmentsOfCollection(ctx, req.DbName, req.CollectionName)
@ -729,7 +729,7 @@ func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvus
resp.Status.Reason = err.Error()
return resp, nil
}
if infoResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if infoResp.Status.ErrorCode != commonpb.ErrorCode_Success {
resp.Status.Reason = infoResp.Status.Reason
return resp, nil
}
@ -747,7 +747,7 @@ func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvus
State: info.State,
}
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.Infos = persistentInfos
return resp, nil
}
@ -755,7 +755,7 @@ func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvus
func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.QuerySegmentInfoRequest) (*milvuspb.QuerySegmentInfoResponse, error) {
resp := &milvuspb.QuerySegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
}
segments, err := node.getSegmentsOfCollection(ctx, req.DbName, req.CollectionName)
@ -776,7 +776,7 @@ func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.Qu
resp.Status.Reason = err.Error()
return resp, nil
}
if infoResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if infoResp.Status.ErrorCode != commonpb.ErrorCode_Success {
resp.Status.Reason = infoResp.Status.Reason
return resp, nil
}
@ -792,7 +792,7 @@ func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.Qu
IndexID: info.IndexID,
}
}
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_Success
resp.Infos = queryInfos
return resp, nil
}
@ -811,7 +811,7 @@ func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName strin
if err != nil {
return nil, err
}
if describeCollectionResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if describeCollectionResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, errors.New(describeCollectionResponse.Status.Reason)
}
collectionID := describeCollectionResponse.CollectionID
@ -829,7 +829,7 @@ func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName strin
if err != nil {
return nil, err
}
if showPartitionsResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if showPartitionsResp.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, errors.New(showPartitionsResp.Status.Reason)
}
@ -848,7 +848,7 @@ func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName strin
if err != nil {
return nil, err
}
if showSegmentResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if showSegmentResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, errors.New(showSegmentResponse.Status.Reason)
}
ret = append(ret, showSegmentResponse.SegmentIDs...)
@ -862,7 +862,7 @@ func (node *ProxyNode) RegisterLink(request *commonpb.Empty) (*milvuspb.Register
return &milvuspb.RegisterLinkResponse{
Address: nil,
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: "proxy node not healthy",
},
}, nil
@ -870,7 +870,7 @@ func (node *ProxyNode) RegisterLink(request *commonpb.Empty) (*milvuspb.Register
return &milvuspb.RegisterLinkResponse{
Address: nil,
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
}, nil

View File

@ -108,7 +108,7 @@ func (m *MetaCache) GetCollectionID(ctx context.Context, collectionName string)
if err != nil {
return 0, err
}
if coll.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if coll.Status.ErrorCode != commonpb.ErrorCode_Success {
return 0, errors.New(coll.Status.Reason)
}
@ -139,7 +139,7 @@ func (m *MetaCache) GetCollectionSchema(ctx context.Context, collectionName stri
if err != nil {
return nil, err
}
if coll.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if coll.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, errors.New(coll.Status.Reason)
}
@ -171,7 +171,7 @@ func (m *MetaCache) GetPartitionID(ctx context.Context, collectionName string, p
if err != nil {
return 0, err
}
if partitions.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if partitions.Status.ErrorCode != commonpb.ErrorCode_Success {
return 0, fmt.Errorf("%s", partitions.Status.Reason)
}
if len(partitions.PartitionIDs) != len(partitions.PartitionNames) {

View File

@ -21,7 +21,7 @@ func (m *MockMasterClientInterface) ShowPartitions(ctx context.Context, in *milv
if in.CollectionName == "collection1" {
return &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
PartitionIDs: []typeutil.UniqueID{1, 2},
PartitionNames: []string{"par1", "par2"},
@ -29,7 +29,7 @@ func (m *MockMasterClientInterface) ShowPartitions(ctx context.Context, in *milv
}
return &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
PartitionIDs: []typeutil.UniqueID{},
PartitionNames: []string{},
@ -40,7 +40,7 @@ func (m *MockMasterClientInterface) DescribeCollection(ctx context.Context, in *
if in.CollectionName == "collection1" {
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
CollectionID: typeutil.UniqueID(1),
Schema: &schemapb.CollectionSchema{
@ -50,7 +50,7 @@ func (m *MockMasterClientInterface) DescribeCollection(ctx context.Context, in *
}
return &milvuspb.DescribeCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
},
CollectionID: typeutil.UniqueID(0),
Schema: nil,

View File

@ -91,7 +91,7 @@ func (node *ProxyNode) Init() error {
if err != nil {
return err
}
if response.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if response.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(response.Status.Reason)
}
@ -129,7 +129,7 @@ func (node *ProxyNode) Init() error {
if err != nil {
return err
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason)
}

View File

@ -299,7 +299,7 @@ func (sa *SegIDAssigner) syncSegments() bool {
now := time.Now()
success := false
for _, info := range resp.SegIDAssignments {
if info.Status.GetErrorCode() != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if info.Status.GetErrorCode() != commonpb.ErrorCode_Success {
log.Debug("proxynode", zap.String("SyncSegment Error", info.Status.Reason))
continue
}

View File

@ -189,7 +189,7 @@ func (it *InsertTask) Execute(ctx context.Context) error {
it.result = &milvuspb.InsertResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
RowIDBegin: rowIDBegin,
RowIDEnd: rowIDEnd,
@ -212,7 +212,7 @@ func (it *InsertTask) Execute(ctx context.Context) error {
if resp == nil {
return errors.New("get insert channels resp is nil")
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason)
}
err = globalInsertChannelsMap.createInsertMsgStream(collID, resp.Values)
@ -222,14 +222,14 @@ func (it *InsertTask) Execute(ctx context.Context) error {
}
stream, err = globalInsertChannelsMap.getInsertMsgStream(collID)
if err != nil {
it.result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
it.result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
it.result.Status.Reason = err.Error()
return err
}
err = stream.Produce(ctx, msgPack)
if err != nil {
it.result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
it.result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
it.result.Status.Reason = err.Error()
return err
}
@ -358,7 +358,7 @@ func (cct *CreateCollectionTask) Execute(ctx context.Context) error {
if err != nil {
return err
}
if cct.result.ErrorCode == commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if cct.result.ErrorCode == commonpb.ErrorCode_Success {
collID, err := globalMetaCache.GetCollectionID(ctx, cct.CollectionName)
if err != nil {
return err
@ -376,7 +376,7 @@ func (cct *CreateCollectionTask) Execute(ctx context.Context) error {
if resp == nil {
return errors.New("get insert channels resp is nil")
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason)
}
err = globalInsertChannelsMap.createInsertMsgStream(collID, resp.Values)
@ -599,7 +599,7 @@ func (st *SearchTask) PostExecute(ctx context.Context) error {
filterSearchResult := make([]*internalpb2.SearchResults, 0)
var filterReason string
for _, partialSearchResult := range searchResults {
if partialSearchResult.Status.ErrorCode == commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if partialSearchResult.Status.ErrorCode == commonpb.ErrorCode_Success {
filterSearchResult = append(filterSearchResult, partialSearchResult)
// For debugging, please don't delete.
//for i := 0; i < len(partialSearchResult.Hits); i++ {
@ -620,7 +620,7 @@ func (st *SearchTask) PostExecute(ctx context.Context) error {
if availableQueryNodeNum <= 0 {
st.result = &milvuspb.SearchResults{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: filterReason,
},
}
@ -650,7 +650,7 @@ func (st *SearchTask) PostExecute(ctx context.Context) error {
if availableQueryNodeNum <= 0 {
st.result = &milvuspb.SearchResults{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: filterReason,
},
}
@ -661,7 +661,7 @@ func (st *SearchTask) PostExecute(ctx context.Context) error {
if nq <= 0 {
st.result = &milvuspb.SearchResults{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: filterReason,
},
}
@ -802,7 +802,7 @@ func (hct *HasCollectionTask) Execute(ctx context.Context) error {
if hct.result == nil {
return errors.New("has collection resp is nil")
}
if hct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if hct.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(hct.result.Status.Reason)
}
return err
@ -873,7 +873,7 @@ func (dct *DescribeCollectionTask) Execute(ctx context.Context) error {
if dct.result == nil {
return errors.New("has collection resp is nil")
}
if dct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if dct.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(dct.result.Status.Reason)
}
return err
@ -953,12 +953,12 @@ func (g *GetCollectionsStatisticsTask) Execute(ctx context.Context) error {
if result == nil {
return errors.New("get collection statistics resp is nil")
}
if result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(result.Status.Reason)
}
g.result = &milvuspb.CollectionStatsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Stats: result.Stats,
@ -1028,7 +1028,7 @@ func (sct *ShowCollectionsTask) Execute(ctx context.Context) error {
if sct.result == nil {
return errors.New("get collection statistics resp is nil")
}
if sct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if sct.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(sct.result.Status.Reason)
}
return err
@ -1105,7 +1105,7 @@ func (cpt *CreatePartitionTask) Execute(ctx context.Context) (err error) {
if cpt.result == nil {
return errors.New("get collection statistics resp is nil")
}
if cpt.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if cpt.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(cpt.result.Reason)
}
return err
@ -1182,7 +1182,7 @@ func (dpt *DropPartitionTask) Execute(ctx context.Context) (err error) {
if dpt.result == nil {
return errors.New("get collection statistics resp is nil")
}
if dpt.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if dpt.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(dpt.result.Reason)
}
return err
@ -1258,7 +1258,7 @@ func (hpt *HasPartitionTask) Execute(ctx context.Context) (err error) {
if hpt.result == nil {
return errors.New("get collection statistics resp is nil")
}
if hpt.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if hpt.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(hpt.result.Status.Reason)
}
return err
@ -1329,7 +1329,7 @@ func (spt *ShowPartitionsTask) Execute(ctx context.Context) error {
if spt.result == nil {
return errors.New("get collection statistics resp is nil")
}
if spt.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if spt.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(spt.result.Status.Reason)
}
return err
@ -1407,7 +1407,7 @@ func (cit *CreateIndexTask) Execute(ctx context.Context) error {
if cit.result == nil {
return errors.New("get collection statistics resp is nil")
}
if cit.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if cit.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(cit.result.Reason)
}
return err
@ -1490,7 +1490,7 @@ func (dit *DescribeIndexTask) Execute(ctx context.Context) error {
if dit.result == nil {
return errors.New("get collection statistics resp is nil")
}
if dit.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if dit.result.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(dit.result.Status.Reason)
}
return err
@ -1568,7 +1568,7 @@ func (dit *DropIndexTask) Execute(ctx context.Context) error {
if dit.result == nil {
return errors.New("drop index resp is nil")
}
if dit.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if dit.result.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(dit.result.Reason)
}
return err
@ -1715,7 +1715,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error {
if err != nil {
return err
}
if segments.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if segments.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(segments.Status.Reason)
}
allSegmentIDs = append(allSegmentIDs, segments.SegmentIDs...)
@ -1757,7 +1757,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error {
if len(allSegmentIDs) != len(indexBuildIDs) {
gist.result = &milvuspb.IndexStateResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
State: commonpb.IndexState_INDEX_STATE_IN_PROGRESS,
@ -1775,7 +1775,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error {
return err
}
if states.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if states.Status.ErrorCode != commonpb.ErrorCode_Success {
gist.result = &milvuspb.IndexStateResponse{
Status: states.Status,
State: commonpb.IndexState_INDEX_STATE_FAILED,
@ -1797,7 +1797,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error {
gist.result = &milvuspb.IndexStateResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
State: commonpb.IndexState_INDEX_STATE_FINISHED,
@ -1882,12 +1882,12 @@ func (ft *FlushTask) Execute(ctx context.Context) error {
if status == nil {
return errors.New("flush resp is nil")
}
if status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(status.Reason)
}
}
ft.result = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
return nil
}

View File

@ -170,7 +170,7 @@ func (s *ProxyService) GetComponentStates(ctx context.Context) (*internalpb2.Com
State: stateInfo,
SubcomponentStates: nil, // todo add subcomponents states
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}
return ret, nil
@ -183,7 +183,7 @@ func (s *ProxyService) UpdateStateCode(code internalpb2.StateCode) {
func (s *ProxyService) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Value: Params.ServiceTimeTickChannel,
}, nil
@ -208,7 +208,7 @@ func (s *ProxyService) RegisterLink(ctx context.Context) (*milvuspb.RegisterLink
if err != nil {
return &milvuspb.RegisterLinkResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
Address: nil,
@ -219,7 +219,7 @@ func (s *ProxyService) RegisterLink(ctx context.Context) (*milvuspb.RegisterLink
if err != nil {
return &milvuspb.RegisterLinkResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
Address: nil,
@ -246,7 +246,7 @@ func (s *ProxyService) RegisterNode(ctx context.Context, request *proxypb.Regist
if err != nil {
return &proxypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
InitParams: nil,
@ -257,7 +257,7 @@ func (s *ProxyService) RegisterNode(ctx context.Context, request *proxypb.Regist
if err != nil {
return &proxypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
InitParams: nil,
@ -282,7 +282,7 @@ func (s *ProxyService) InvalidateCollectionMetaCache(ctx context.Context, reques
err = s.sched.InvalidateCollectionMetaCacheTaskQueue.Enqueue(t)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}
@ -290,7 +290,7 @@ func (s *ProxyService) InvalidateCollectionMetaCache(ctx context.Context, reques
err = t.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, nil
}

View File

@ -100,7 +100,7 @@ func (t *RegisterLinkTask) Execute(ctx context.Context) error {
Port: info.port,
},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
}
@ -147,7 +147,7 @@ func (t *RegisterNodeTask) Execute(ctx context.Context) error {
// TODO: fill init params
t.response = &proxypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
InitParams: &internalpb2.InitParams{
@ -197,12 +197,12 @@ func (t *InvalidateCollectionMetaCacheTask) Execute(ctx context.Context) error {
if status == nil {
return errors.New("invalidate collection meta cache error")
}
if status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(status.Reason)
}
}
t.response = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
return nil
}

View File

@ -511,7 +511,7 @@ func (colReplica *collectionReplica) getSegmentsBySegmentType(segType segmentTyp
for _, segment := range colReplica.segments {
if segment.getType() == segType {
if segType == segTypeSealed && !segment.getEnableIndex() {
if segType == segmentTypeSealed && !segment.getEnableIndex() {
continue
}
@ -527,12 +527,12 @@ func (colReplica *collectionReplica) getSegmentsBySegmentType(segType segmentTyp
func (colReplica *collectionReplica) replaceGrowingSegmentBySealedSegment(segment *Segment) error {
colReplica.mu.Lock()
defer colReplica.mu.Unlock()
if segment.segmentType != segTypeSealed && segment.segmentType != segTypeIndexing {
if segment.segmentType != segmentTypeSealed && segment.segmentType != segTypeIndexing {
return errors.New("unexpected segment type")
}
targetSegment, err := colReplica.getSegmentByIDPrivate(segment.ID())
if err == nil && targetSegment != nil {
if targetSegment.segmentType != segTypeGrowing {
if targetSegment.segmentType != segmentTypeGrowing {
// target segment has been a sealed segment
return nil
}
@ -548,7 +548,7 @@ func (colReplica *collectionReplica) setSegmentEnableIndex(segmentID UniqueID, e
defer colReplica.mu.Unlock()
targetSegment, err := colReplica.getSegmentByIDPrivate(segmentID)
if targetSegment.segmentType != segTypeSealed {
if targetSegment.segmentType != segmentTypeSealed {
return errors.New("unexpected segment type")
}
if err == nil && targetSegment != nil {

View File

@ -161,7 +161,7 @@ func TestCollectionReplica_addSegment(t *testing.T) {
const segmentNum = 3
for i := 0; i < segmentNum; i++ {
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segTypeGrowing)
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segmentTypeGrowing)
assert.NoError(t, err)
targetSeg, err := node.replica.getSegmentByID(UniqueID(i))
assert.NoError(t, err)
@ -180,7 +180,7 @@ func TestCollectionReplica_removeSegment(t *testing.T) {
const segmentNum = 3
for i := 0; i < segmentNum; i++ {
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segTypeGrowing)
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segmentTypeGrowing)
assert.NoError(t, err)
targetSeg, err := node.replica.getSegmentByID(UniqueID(i))
assert.NoError(t, err)
@ -201,7 +201,7 @@ func TestCollectionReplica_getSegmentByID(t *testing.T) {
const segmentNum = 3
for i := 0; i < segmentNum; i++ {
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segTypeGrowing)
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segmentTypeGrowing)
assert.NoError(t, err)
targetSeg, err := node.replica.getSegmentByID(UniqueID(i))
assert.NoError(t, err)
@ -220,7 +220,7 @@ func TestCollectionReplica_hasSegment(t *testing.T) {
const segmentNum = 3
for i := 0; i < segmentNum; i++ {
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segTypeGrowing)
err := node.replica.addSegment(UniqueID(i), defaultPartitionID, collectionID, segmentTypeGrowing)
assert.NoError(t, err)
targetSeg, err := node.replica.getSegmentByID(UniqueID(i))
assert.NoError(t, err)
@ -250,12 +250,12 @@ func TestReplaceGrowingSegmentBySealedSegment(t *testing.T) {
segmentID := UniqueID(520)
initTestMeta(t, node, collectionID, segmentID)
_, _, segIDs := node.replica.getSegmentsBySegmentType(segTypeGrowing)
_, _, segIDs := node.replica.getSegmentsBySegmentType(segmentTypeGrowing)
assert.Equal(t, len(segIDs), 1)
collection, err := node.replica.getCollectionByID(collectionID)
assert.NoError(t, err)
ns := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeSealed)
ns := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeSealed)
err = node.replica.replaceGrowingSegmentBySealedSegment(ns)
assert.NoError(t, err)
err = node.replica.setSegmentEnableIndex(segmentID, true)
@ -267,11 +267,11 @@ func TestReplaceGrowingSegmentBySealedSegment(t *testing.T) {
segment, err := node.replica.getSegmentByID(segmentID)
assert.NoError(t, err)
assert.Equal(t, segment.getType(), segTypeSealed)
assert.Equal(t, segment.getType(), segmentTypeSealed)
_, _, segIDs = node.replica.getSegmentsBySegmentType(segTypeGrowing)
_, _, segIDs = node.replica.getSegmentsBySegmentType(segmentTypeGrowing)
assert.Equal(t, len(segIDs), 0)
_, _, segIDs = node.replica.getSegmentsBySegmentType(segTypeSealed)
_, _, segIDs = node.replica.getSegmentsBySegmentType(segmentTypeSealed)
assert.Equal(t, len(segIDs), 1)
err = node.Stop()

View File

@ -56,7 +56,7 @@ func (iNode *insertNode) Operate(ctx context.Context, in []Msg) ([]Msg, context.
// check if segment exists, if not, create this segment
if !iNode.replica.hasSegment(task.SegmentID) {
err := iNode.replica.addSegment(task.SegmentID, task.PartitionID, task.CollectionID, segTypeGrowing)
err := iNode.replica.addSegment(task.SegmentID, task.PartitionID, task.CollectionID, segmentTypeGrowing)
if err != nil {
log.Error(err.Error())
continue

View File

@ -24,13 +24,13 @@ func (s *Segment) buildIndex(collection *Collection) commonpb.Status {
*/
var status = C.BuildIndex(collection.collectionPtr, s.segmentPtr)
if status != 0 {
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_BuildIndexError}
}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}
}
func (s *Segment) dropIndex(fieldID int64) commonpb.Status {
// WARN: Not support yet
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}
}

View File

@ -46,7 +46,7 @@ type loadIndex struct {
}
func (loader *indexLoader) doLoadIndex(wg *sync.WaitGroup) {
collectionIDs, _, segmentIDs := loader.replica.getSegmentsBySegmentType(segTypeSealed)
collectionIDs, _, segmentIDs := loader.replica.getSegmentsBySegmentType(segmentTypeSealed)
if len(collectionIDs) <= 0 {
wg.Done()
return
@ -321,7 +321,7 @@ func (loader *indexLoader) getIndexInfo(collectionID UniqueID, segmentID UniqueI
if err != nil {
return 0, 0, err
}
if response.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if response.Status.ErrorCode != commonpb.ErrorCode_Success {
return -1, -1, errors.New(response.Status.Reason)
}
@ -342,7 +342,7 @@ func (loader *indexLoader) getIndexPaths(indexBuildID UniqueID) ([]string, error
IndexBuildIDs: []UniqueID{indexBuildID},
}
pathResponse, err := loader.indexService.GetIndexFilePaths(ctx, indexFilePathRequest)
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, err
}

View File

@ -47,7 +47,7 @@ func (s *loadService) close() {
}
func (s *loadService) loadSegmentActively(wg *sync.WaitGroup) {
collectionIDs, partitionIDs, segmentIDs := s.segLoader.replica.getSegmentsBySegmentType(segTypeGrowing)
collectionIDs, partitionIDs, segmentIDs := s.segLoader.replica.getSegmentsBySegmentType(segmentTypeGrowing)
if len(collectionIDs) <= 0 {
wg.Done()
return
@ -86,7 +86,7 @@ func (s *loadService) loadSegment(collectionID UniqueID, partitionID UniqueID, s
}
}
for _, segmentID := range segmentIDs {
err := s.segLoader.replica.addSegment(segmentID, partitionID, collectionID, segTypeGrowing)
err := s.segLoader.replica.addSegment(segmentID, partitionID, collectionID, segmentTypeGrowing)
if err != nil {
log.Warn(err.Error())
continue
@ -118,7 +118,7 @@ func (s *loadService) loadSegmentInternal(collectionID UniqueID, partitionID Uni
if err != nil {
return err
}
segment := newSegment(collection, segmentID, partitionID, collectionID, segTypeSealed)
segment := newSegment(collection, segmentID, partitionID, collectionID, segmentTypeSealed)
// we don't need index id yet
_, buildID, errIndex := s.segLoader.indexLoader.getIndexInfo(collectionID, segmentID)
if errIndex == nil {

View File

@ -1136,7 +1136,7 @@ func TestSegmentLoad_Search_Vector(t *testing.T) {
err := node.replica.addPartition(collectionID, partitionID)
assert.NoError(t, err)
err = node.replica.addSegment(segmentID, partitionID, collectionID, segTypeSealed)
err = node.replica.addSegment(segmentID, partitionID, collectionID, segmentTypeSealed)
assert.NoError(t, err)
paths, srcFieldIDs, err := generateInsertBinLog(collectionID, partitionID, segmentID, keyPrefix)

View File

@ -152,7 +152,7 @@ func (mService *metaService) processSegmentCreate(id string, value string) {
// TODO: what if seg == nil? We need to notify master and return rpc request failed
if seg != nil {
// TODO: get partition id from segment meta
err := mService.replica.addSegment(seg.SegmentID, seg.PartitionID, seg.CollectionID, segTypeGrowing)
err := mService.replica.addSegment(seg.SegmentID, seg.PartitionID, seg.CollectionID, segmentTypeGrowing)
if err != nil {
log.Error(err.Error())
return

View File

@ -108,7 +108,7 @@ func (node *QueryNode) Init() error {
ctx := context.Background()
registerReq := &queryPb.RegisterNodeRequest{
Base: &commonpb.MsgBase{
MsgType: commonpb.MsgType_None,
MsgType: commonpb.MsgType_UnSpecific,
SourceID: Params.QueryNodeID,
},
Address: &commonpb.Address{
@ -121,7 +121,7 @@ func (node *QueryNode) Init() error {
if err != nil {
panic(err)
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
panic(resp.Status.Reason)
}
@ -248,14 +248,14 @@ func (node *QueryNode) SetDataService(data types.DataService) error {
func (node *QueryNode) GetComponentStates() (*internalpb2.ComponentStates, error) {
stats := &internalpb2.ComponentStates{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}
code, ok := node.stateCode.Load().(internalpb2.StateCode)
if !ok {
errMsg := "unexpected error in type assertion"
stats.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
return stats, errors.New(errMsg)
@ -281,7 +281,7 @@ func (node *QueryNode) AddQueryChannel(in *queryPb.AddQueryChannelsRequest) (*co
if node.searchService == nil || node.searchService.searchMsgStream == nil {
errMsg := "null search service or null search message stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -300,7 +300,7 @@ func (node *QueryNode) AddQueryChannel(in *queryPb.AddQueryChannelsRequest) (*co
log.Debug("querynode AsProducer: " + strings.Join(producerChannels, ", "))
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
return status, nil
}
@ -309,7 +309,7 @@ func (node *QueryNode) RemoveQueryChannel(in *queryPb.RemoveQueryChannelsRequest
if node.searchService == nil || node.searchService.searchMsgStream == nil {
errMsg := "null search service or null search result message stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -320,7 +320,7 @@ func (node *QueryNode) RemoveQueryChannel(in *queryPb.RemoveQueryChannelsRequest
if !ok {
errMsg := "type assertion failed for search message stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -331,7 +331,7 @@ func (node *QueryNode) RemoveQueryChannel(in *queryPb.RemoveQueryChannelsRequest
if !ok {
errMsg := "type assertion failed for search result message stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -350,7 +350,7 @@ func (node *QueryNode) RemoveQueryChannel(in *queryPb.RemoveQueryChannelsRequest
resultStream.AsProducer(producerChannels)
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
return status, nil
}
@ -359,7 +359,7 @@ func (node *QueryNode) WatchDmChannels(in *queryPb.WatchDmChannelsRequest) (*com
if node.dataSyncService == nil || node.dataSyncService.dmStream == nil {
errMsg := "null data sync service or null data manipulation stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -373,7 +373,7 @@ func (node *QueryNode) WatchDmChannels(in *queryPb.WatchDmChannelsRequest) (*com
_ = t
errMsg := "type assertion failed for dm message stream"
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: errMsg,
}
@ -387,7 +387,7 @@ func (node *QueryNode) WatchDmChannels(in *queryPb.WatchDmChannelsRequest) (*com
log.Debug("querynode AsConsumer: " + strings.Join(consumeChannels, ", ") + " : " + consumeSubName)
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
return status, nil
}
@ -403,14 +403,14 @@ func (node *QueryNode) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.S
log.Debug("query node load segment", zap.String("loadSegmentRequest", fmt.Sprintln(in)))
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
hasCollection := node.replica.hasCollection(collectionID)
hasPartition := node.replica.hasPartition(partitionID)
if !hasCollection {
err := node.replica.addCollection(collectionID, schema)
if err != nil {
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
return status, err
}
@ -418,14 +418,14 @@ func (node *QueryNode) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.S
if !hasPartition {
err := node.replica.addPartition(collectionID, partitionID)
if err != nil {
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
return status, err
}
}
err := node.replica.enablePartition(partitionID)
if err != nil {
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
return status, err
}
@ -436,7 +436,7 @@ func (node *QueryNode) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.S
if len(in.SegmentIDs) != len(in.SegmentStates) {
err := errors.New("len(segmentIDs) should equal to len(segmentStates)")
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
return status, err
}
@ -460,7 +460,7 @@ func (node *QueryNode) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.S
err = node.dataSyncService.seekSegment(position)
if err != nil {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}
return status, err
@ -468,7 +468,7 @@ func (node *QueryNode) LoadSegments(in *queryPb.LoadSegmentRequest) (*commonpb.S
err = node.loadService.loadSegment(collectionID, partitionID, segmentIDs, fieldIDs)
if err != nil {
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
return status, err
}
@ -479,26 +479,26 @@ func (node *QueryNode) ReleaseCollection(in *queryPb.ReleaseCollectionRequest) (
err := node.replica.removeCollection(in.CollectionID)
if err != nil {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}
return status, err
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
func (node *QueryNode) ReleasePartitions(in *queryPb.ReleasePartitionRequest) (*commonpb.Status, error) {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
for _, id := range in.PartitionIDs {
err := node.loadService.segLoader.replica.removePartition(id)
if err != nil {
// not return, try to release all partitions
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err.Error()
}
}
@ -507,13 +507,13 @@ func (node *QueryNode) ReleasePartitions(in *queryPb.ReleasePartitionRequest) (*
func (node *QueryNode) ReleaseSegments(in *queryPb.ReleaseSegmentRequest) (*commonpb.Status, error) {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
for _, id := range in.SegmentIDs {
err2 := node.loadService.segLoader.replica.removeSegment(id)
if err2 != nil {
// not return, try to release all segments
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_UnexpectedError
status.Reason = err2.Error()
}
}
@ -540,7 +540,7 @@ func (node *QueryNode) GetSegmentInfo(in *queryPb.SegmentInfoRequest) (*queryPb.
}
return &queryPb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Infos: infos,
}, nil

View File

@ -125,7 +125,7 @@ func initTestMeta(t *testing.T, node *QueryNode, collectionID UniqueID, segmentI
err = node.replica.addPartition(collection.ID(), collectionMeta.PartitionIDs[0])
assert.NoError(t, err)
err = node.replica.addSegment(segmentID, collectionMeta.PartitionIDs[0], collectionID, segTypeGrowing)
err = node.replica.addSegment(segmentID, collectionMeta.PartitionIDs[0], collectionID, segmentTypeGrowing)
assert.NoError(t, err)
}
@ -196,7 +196,7 @@ func refreshChannelNames() {
func (q *queryServiceMock) RegisterNode(ctx context.Context, req *querypb.RegisterNodeRequest) (*querypb.RegisterNodeResponse, error) {
return &querypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
InitParams: &internalpb2.InitParams{
NodeID: int64(1),

View File

@ -18,7 +18,7 @@ func TestReduce_AllFunc(t *testing.T) {
collectionMeta := genTestCollectionMeta(collectionID, false)
collection := newCollection(collectionMeta.ID, collectionMeta.Schema)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
const DIM = 16
var vec = [DIM]float32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}

View File

@ -304,7 +304,7 @@ func (ss *searchService) search(msg msgstream.TsMsg) error {
Timestamp: searchTimestamp,
SourceID: searchMsg.Base.SourceID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
ResultChannelID: searchMsg.ResultChannelID,
Hits: nilHits,
MetricType: plan.getMetricType(),
@ -366,7 +366,7 @@ func (ss *searchService) search(msg msgstream.TsMsg) error {
Timestamp: searchTimestamp,
SourceID: searchMsg.Base.SourceID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_Success},
ResultChannelID: searchMsg.ResultChannelID,
Hits: hits,
MetricType: plan.getMetricType(),
@ -427,7 +427,7 @@ func (ss *searchService) publishFailedSearchResult(msg msgstream.TsMsg, errMsg s
Timestamp: searchMsg.Base.Timestamp,
SourceID: searchMsg.Base.SourceID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR, Reason: errMsg},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_UnexpectedError, Reason: errMsg},
ResultChannelID: searchMsg.ResultChannelID,
Hits: [][]byte{},
},

View File

@ -25,14 +25,15 @@ import (
"github.com/zilliztech/milvus-distributed/internal/proto/commonpb"
)
type segmentType int32
const (
segTypeInvalid = iota
segTypeGrowing
segTypeSealed
segmentTypeInvalid segmentType = iota
segmentTypeGrowing
segmentTypeSealed
segTypeIndexing
)
type segmentType = int
type indexParam = map[string]string
type Segment struct {
@ -51,7 +52,7 @@ type Segment struct {
recentlyModified bool
typeMu sync.Mutex // guards builtIndex
segmentType int
segmentType segmentType
paramMutex sync.RWMutex // guards index
indexParam map[int64]indexParam
@ -132,12 +133,12 @@ func newSegment(collection *Collection, segmentID int64, partitionID UniqueID, c
initIndexParam := make(map[int64]indexParam)
var segmentPtr C.CSegmentInterface
switch segType {
case segTypeInvalid:
case segmentTypeInvalid:
log.Error("illegal segment type when create segment")
return nil
case segTypeSealed:
case segmentTypeSealed:
segmentPtr = C.NewSegment(collection.collectionPtr, C.ulong(segmentID), C.Sealed)
case segTypeGrowing:
case segmentTypeGrowing:
segmentPtr = C.NewSegment(collection.collectionPtr, C.ulong(segmentID), C.Growing)
default:
log.Error("illegal segment type when create segment")
@ -234,7 +235,7 @@ func (s *Segment) segmentSearch(plan *Plan,
var cPlaceHolder = (*C.CPlaceholderGroup)(&cPlaceholderGroups[0])
var cNumGroups = C.int(len(placeHolderGroups))
log.Debug("do search on segment", zap.Int64("segmentID", s.segmentID), zap.Int("segType", s.segmentType))
log.Debug("do search on segment", zap.Int64("segmentID", s.segmentID), zap.Int32("segmentType", int32(s.segmentType)))
var status = C.Search(s.segmentPtr, plan.cPlan, cPlaceHolder, cTimestamp, cNumGroups, &searchResult.cQueryResult)
errorCode := status.error_code
@ -272,9 +273,9 @@ func (s *Segment) updateSegmentIndex(loadIndexInfo *LoadIndexInfo) error {
}
var status C.CStatus
if s.segmentType == segTypeGrowing {
if s.segmentType == segmentTypeGrowing {
status = C.UpdateSegmentIndex(s.segmentPtr, loadIndexInfo.cLoadIndexInfo)
} else if s.segmentType == segTypeSealed {
} else if s.segmentType == segmentTypeSealed {
status = C.UpdateSealedSegmentIndex(s.segmentPtr, loadIndexInfo.cLoadIndexInfo)
} else {
return errors.New("illegal segment type")
@ -445,7 +446,7 @@ func (s *Segment) segmentLoadFieldData(fieldID int64, rowCount int, data interfa
if s.segmentPtr == nil {
return errors.New("null seg core pointer")
}
if s.segmentType != segTypeSealed {
if s.segmentType != segmentTypeSealed {
return errors.New("illegal segment type when loading field data")
}

View File

@ -42,7 +42,7 @@ func (loader *segmentLoader) getInsertBinlogPaths(segmentID UniqueID) ([]*intern
}
pathResponse, err := loader.dataService.GetInsertBinlogPaths(ctx, insertBinlogPathRequest)
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, nil, err
}
@ -63,7 +63,7 @@ func (loader *segmentLoader) GetSegmentStates(segmentID UniqueID) (*datapb.Segme
SegmentIDs: []int64{segmentID},
}
statesResponse, err := loader.dataService.GetSegmentStates(ctx, segmentStatesRequest)
if err != nil || statesResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if err != nil || statesResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return nil, err
}
if len(statesResponse.States) != 1 {

View File

@ -22,7 +22,7 @@ func TestSegment_newSegment(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
deleteSegment(segment)
deleteCollection(collection)
@ -36,7 +36,7 @@ func TestSegment_deleteSegment(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
deleteSegment(segment)
@ -52,7 +52,7 @@ func TestSegment_getRowCount(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -99,7 +99,7 @@ func TestSegment_getDeletedCount(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -152,7 +152,7 @@ func TestSegment_getMemSize(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -199,7 +199,7 @@ func TestSegment_segmentInsert(t *testing.T) {
collection := newCollection(collectionMeta.ID, collectionMeta.Schema)
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -242,7 +242,7 @@ func TestSegment_segmentDelete(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -291,7 +291,7 @@ func TestSegment_segmentSearch(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -405,7 +405,7 @@ func TestSegment_segmentPreInsert(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
const DIM = 16
@ -443,7 +443,7 @@ func TestSegment_segmentPreDelete(t *testing.T) {
assert.Equal(t, collection.ID(), collectionID)
segmentID := UniqueID(0)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segTypeGrowing)
segment := newSegment(collection, segmentID, defaultPartitionID, collectionID, segmentTypeGrowing)
assert.Equal(t, segmentID, segment.segmentID)
ids := []int64{1, 2, 3}
@ -491,7 +491,7 @@ func TestSegment_segmentLoadFieldData(t *testing.T) {
segmentID := UniqueID(0)
partitionID := UniqueID(0)
segment := newSegment(collection, segmentID, partitionID, collectionID, segTypeSealed)
segment := newSegment(collection, segmentID, partitionID, collectionID, segmentTypeSealed)
assert.Equal(t, segmentID, segment.segmentID)
assert.Equal(t, partitionID, segment.partitionID)

View File

@ -56,7 +56,7 @@ func (master *MasterMock) ShowPartitions(ctx context.Context, in *milvuspb.ShowP
}
response := &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
PartitionIDs: partitionIDs,
}
@ -75,7 +75,7 @@ func (master *MasterMock) ShowSegments(ctx context.Context, in *milvuspb.ShowSeg
if partition == partitionID {
return &milvuspb.ShowSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
//SegmentIDs: master.Partition2segment[partition],
}, nil
@ -102,7 +102,7 @@ func NewDataMock() *DataMock {
fillStates := func(segmentID UniqueID, time uint64, position *internalpb2.MsgPosition) *datapb.SegmentStateInfo {
return &datapb.SegmentStateInfo{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
SegmentID: segmentID,
State: commonpb.SegmentState_SegmentFlushed,
@ -127,7 +127,7 @@ func NewDataMock() *DataMock {
func (data *DataMock) GetSegmentStates(ctx context.Context, req *datapb.SegmentStatesRequest) (*datapb.SegmentStatesResponse, error) {
ret := &datapb.SegmentStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
}
for _, segID := range req.SegmentIDs {
@ -147,7 +147,7 @@ func (data *DataMock) GetSegmentStates(ctx context.Context, req *datapb.SegmentS
func (data *DataMock) GetInsertChannels(ctx context.Context, req *datapb.InsertChannelRequest) (*internalpb2.StringList, error) {
return &internalpb2.StringList{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Values: []string{"insert-0", "insert-1", "insert-2", "insert-3"},
}, nil

View File

@ -135,7 +135,7 @@ func (qs *QueryService) GetComponentStates(ctx context.Context) (*internalpb2.Co
}
return &internalpb2.ComponentStates{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
State: serviceComponentInfo,
SubcomponentStates: subComponentInfos,
@ -145,7 +145,7 @@ func (qs *QueryService) GetComponentStates(ctx context.Context) (*internalpb2.Co
func (qs *QueryService) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: Params.TimeTickChannelName,
@ -155,7 +155,7 @@ func (qs *QueryService) GetTimeTickChannel(ctx context.Context) (*milvuspb.Strin
func (qs *QueryService) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: "",
},
Value: Params.StatsChannelName,
@ -170,7 +170,7 @@ func (qs *QueryService) RegisterNode(ctx context.Context, req *querypb.RegisterN
err := errors.New("nodeID already exists")
return &querypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: err.Error(),
},
}, err
@ -181,7 +181,7 @@ func (qs *QueryService) RegisterNode(ctx context.Context, req *querypb.RegisterN
if err := client.Init(); err != nil {
return &querypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
InitParams: new(internalpb2.InitParams),
}, err
@ -211,7 +211,7 @@ func (qs *QueryService) RegisterNode(ctx context.Context, req *querypb.RegisterN
return &querypb.RegisterNodeResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
InitParams: &internalpb2.InitParams{
NodeID: nodeID,
@ -231,7 +231,7 @@ func (qs *QueryService) ShowCollections(ctx context.Context, req *querypb.ShowCo
if err != nil {
return &querypb.ShowCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
Reason: err.Error(),
},
}, err
@ -239,7 +239,7 @@ func (qs *QueryService) ShowCollections(ctx context.Context, req *querypb.ShowCo
log.Debug("show collection end")
return &querypb.ShowCollectionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
CollectionIDs: collectionIDs,
}, nil
@ -252,12 +252,12 @@ func (qs *QueryService) LoadCollection(ctx context.Context, req *querypb.LoadCol
fn := func(err error) *commonpb.Status {
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
}
@ -288,7 +288,7 @@ func (qs *QueryService) LoadCollection(ctx context.Context, req *querypb.LoadCol
if err != nil {
return fn(err), err
}
if showPartitionResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if showPartitionResponse.Status.ErrorCode != commonpb.ErrorCode_Success {
return showPartitionResponse.Status, err
}
partitionIDs := showPartitionResponse.PartitionIDs
@ -316,7 +316,7 @@ func (qs *QueryService) LoadCollection(ctx context.Context, req *querypb.LoadCol
return &commonpb.Status{
Reason: "Partitions has been already loaded!",
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -342,7 +342,7 @@ func (qs *QueryService) ReleaseCollection(ctx context.Context, req *querypb.Rele
if err != nil {
log.Error("release collection end, query service don't have the log of", zap.String("collectionID", fmt.Sprintln(collectionID)))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -357,7 +357,7 @@ func (qs *QueryService) ReleaseCollection(ctx context.Context, req *querypb.Rele
err = qs.replica.releaseCollection(dbID, collectionID)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, err
}
@ -365,7 +365,7 @@ func (qs *QueryService) ReleaseCollection(ctx context.Context, req *querypb.Rele
log.Debug("release collection end")
//TODO:: queryNode cancel subscribe dmChannels
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -380,14 +380,14 @@ func (qs *QueryService) ShowPartitions(ctx context.Context, req *querypb.ShowPar
if err != nil {
return &querypb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, err
}
return &querypb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
PartitionIDs: partitionIDs,
}, nil
@ -403,12 +403,12 @@ func (qs *QueryService) LoadPartitions(ctx context.Context, req *querypb.LoadPar
fn := func(err error) *commonpb.Status {
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}
}
log.Debug("load partitions start", zap.String("partitionIDs", fmt.Sprintln(partitionIDs)))
@ -523,7 +523,7 @@ func (qs *QueryService) LoadPartitions(ctx context.Context, req *querypb.LoadPar
log.Debug("load partitions end", zap.String("partitionIDs", fmt.Sprintln(partitionIDs)))
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -553,7 +553,7 @@ func (qs *QueryService) ReleasePartitions(ctx context.Context, req *querypb.Rele
err := qs.replica.releasePartition(dbID, collectionID, partitionID)
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
}, err
}
@ -562,7 +562,7 @@ func (qs *QueryService) ReleasePartitions(ctx context.Context, req *querypb.Rele
log.Debug("start release partitions end")
//TODO:: queryNode cancel subscribe dmChannels
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
}, nil
}
@ -593,7 +593,7 @@ func (qs *QueryService) CreateQueryChannel(ctx context.Context) (*querypb.Create
qs.qcMutex.Unlock()
return &querypb.CreateQueryChannelResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, err
@ -603,7 +603,7 @@ func (qs *QueryService) CreateQueryChannel(ctx context.Context) (*querypb.Create
return &querypb.CreateQueryChannelResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
RequestChannel: allocatedQueryChannel,
ResultChannel: allocatedQueryResultChannel,
@ -615,7 +615,7 @@ func (qs *QueryService) GetPartitionStates(ctx context.Context, req *querypb.Par
if err != nil {
return &querypb.PartitionStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
PartitionDescriptions: states,
@ -623,7 +623,7 @@ func (qs *QueryService) GetPartitionStates(ctx context.Context, req *querypb.Par
}
return &querypb.PartitionStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
PartitionDescriptions: states,
}, nil
@ -636,7 +636,7 @@ func (qs *QueryService) GetSegmentInfo(ctx context.Context, req *querypb.Segment
if err != nil {
return &querypb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, err
@ -645,7 +645,7 @@ func (qs *QueryService) GetSegmentInfo(ctx context.Context, req *querypb.Segment
}
return &querypb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
ErrorCode: commonpb.ErrorCode_Success,
},
Infos: segmentInfos,
}, nil

View File

@ -61,7 +61,7 @@ func TestQueryService_load(t *testing.T) {
}
response, err := service.LoadCollection(ctx, loadCollectionRequest)
assert.Nil(t, err)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_Success)
})
t.Run("Test LoadPartition", func(t *testing.T) {
@ -71,6 +71,6 @@ func TestQueryService_load(t *testing.T) {
}
response, err := service.LoadPartitions(ctx, loadPartitionRequest)
assert.Nil(t, err)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_Success)
})
}

View File

@ -168,7 +168,7 @@ func (w *PayloadWriter) AddBoolToPayload(msgs []bool) error {
status := C.AddBooleanToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -187,7 +187,7 @@ func (w *PayloadWriter) AddInt8ToPayload(msgs []int8) error {
status := C.AddInt8ToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -207,7 +207,7 @@ func (w *PayloadWriter) AddInt16ToPayload(msgs []int16) error {
status := C.AddInt16ToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -227,7 +227,7 @@ func (w *PayloadWriter) AddInt32ToPayload(msgs []int32) error {
status := C.AddInt32ToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -247,7 +247,7 @@ func (w *PayloadWriter) AddInt64ToPayload(msgs []int64) error {
status := C.AddInt64ToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -267,7 +267,7 @@ func (w *PayloadWriter) AddFloatToPayload(msgs []float32) error {
status := C.AddFloatToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -287,7 +287,7 @@ func (w *PayloadWriter) AddDoubleToPayload(msgs []float64) error {
status := C.AddDoubleToPayload(w.payloadWriterPtr, cMsgs, cLength)
errCode := commonpb.ErrorCode(status.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(status.error_msg)
defer C.free(unsafe.Pointer(status.error_msg))
return errors.New(msg)
@ -308,7 +308,7 @@ func (w *PayloadWriter) AddOneStringToPayload(msg string) error {
st := C.AddOneStringToPayload(w.payloadWriterPtr, cmsg, clength)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -333,7 +333,7 @@ func (w *PayloadWriter) AddBinaryVectorToPayload(binVec []byte, dim int) error {
st := C.AddBinaryVectorToPayload(w.payloadWriterPtr, cBinVec, cDim, cLength)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -358,7 +358,7 @@ func (w *PayloadWriter) AddFloatVectorToPayload(floatVec []float32, dim int) err
st := C.AddFloatVectorToPayload(w.payloadWriterPtr, cBinVec, cDim, cLength)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -369,7 +369,7 @@ func (w *PayloadWriter) AddFloatVectorToPayload(floatVec []float32, dim int) err
func (w *PayloadWriter) FinishPayloadWriter() error {
st := C.FinishPayloadWriter(w.payloadWriterPtr)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -397,7 +397,7 @@ func (w *PayloadWriter) GetPayloadLengthFromWriter() (int, error) {
func (w *PayloadWriter) ReleasePayloadWriter() error {
st := C.ReleasePayloadWriter(w.payloadWriterPtr)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -482,7 +482,7 @@ func (r *PayloadReader) GetDataFromPayload(idx ...int) (interface{}, int, error)
func (r *PayloadReader) ReleasePayloadReader() error {
st := C.ReleasePayloadReader(r.payloadReaderPtr)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return errors.New(msg)
@ -500,7 +500,7 @@ func (r *PayloadReader) GetBoolFromPayload() ([]bool, error) {
st := C.GetBoolFromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -520,7 +520,7 @@ func (r *PayloadReader) GetInt8FromPayload() ([]int8, error) {
st := C.GetInt8FromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -540,7 +540,7 @@ func (r *PayloadReader) GetInt16FromPayload() ([]int16, error) {
st := C.GetInt16FromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -560,7 +560,7 @@ func (r *PayloadReader) GetInt32FromPayload() ([]int32, error) {
st := C.GetInt32FromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -580,7 +580,7 @@ func (r *PayloadReader) GetInt64FromPayload() ([]int64, error) {
st := C.GetInt64FromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -600,7 +600,7 @@ func (r *PayloadReader) GetFloatFromPayload() ([]float32, error) {
st := C.GetFloatFromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -620,7 +620,7 @@ func (r *PayloadReader) GetDoubleFromPayload() ([]float64, error) {
st := C.GetDoubleFromPayload(r.payloadReaderPtr, &cMsg, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, errors.New(msg)
@ -641,7 +641,7 @@ func (r *PayloadReader) GetOneStringFromPayload(idx int) (string, error) {
st := C.GetOneStringFromPayload(r.payloadReaderPtr, C.int(idx), &cStr, &cSize)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return "", errors.New(msg)
@ -661,7 +661,7 @@ func (r *PayloadReader) GetBinaryVectorFromPayload() ([]byte, int, error) {
st := C.GetBinaryVectorFromPayload(r.payloadReaderPtr, &cMsg, &cDim, &cLen)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, 0, errors.New(msg)
@ -684,7 +684,7 @@ func (r *PayloadReader) GetFloatVectorFromPayload() ([]float32, int, error) {
st := C.GetFloatVectorFromPayload(r.payloadReaderPtr, &cMsg, &cDim, &cLen)
errCode := commonpb.ErrorCode(st.error_code)
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if errCode != commonpb.ErrorCode_Success {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, 0, errors.New(msg)

View File

@ -55,7 +55,7 @@ func WaitForComponentStates(ctx context.Context, service StateComponent, service
return err
}
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_Success {
return errors.New(resp.Status.Reason)
}