提交 455cc59d 编写于 作者: Q quicksilver 提交者: yefu.chen

Update publish-test-images.yaml

Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>
上级 b91696c6
......@@ -6,12 +6,12 @@ on:
push:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'build/docker/env/**'
- 'build/docker/test/**'
- '.github/workflows/publish-test-images.yaml'
pull_request:
# file paths to consider in the event. Optional; defaults to all.
paths:
- 'build/docker/env/**'
- 'build/docker/test/**'
- '.github/workflows/publish-test-images.yaml'
jobs:
......
......@@ -232,51 +232,58 @@ 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*\315\004\n\tE"
"rrorCode\022\013\n\007SUCCESS\020\000\022\024\n\020UNEXPECTED_ERRO"
"R\020\001\022\022\n\016CONNECT_FAILED\020\002\022\025\n\021PERMISSION_DE"
"NIED\020\003\022\031\n\025COLLECTION_NOT_EXISTS\020\004\022\024\n\020ILL"
"EGAL_ARGUMENT\020\005\022\025\n\021ILLEGAL_DIMENSION\020\007\022\026"
"\n\022ILLEGAL_INDEX_TYPE\020\010\022\033\n\027ILLEGAL_COLLEC"
"TION_NAME\020\t\022\020\n\014ILLEGAL_TOPK\020\n\022\025\n\021ILLEGAL"
"_ROWRECORD\020\013\022\025\n\021ILLEGAL_VECTOR_ID\020\014\022\031\n\025I"
"LLEGAL_SEARCH_RESULT\020\r\022\022\n\016FILE_NOT_FOUND"
"\020\016\022\017\n\013META_FAILED\020\017\022\020\n\014CACHE_FAILED\020\020\022\030\n"
"\024CANNOT_CREATE_FOLDER\020\021\022\026\n\022CANNOT_CREATE"
"_FILE\020\022\022\030\n\024CANNOT_DELETE_FOLDER\020\023\022\026\n\022CAN"
"NOT_DELETE_FILE\020\024\022\025\n\021BUILD_INDEX_ERROR\020\025"
"\022\021\n\rILLEGAL_NLIST\020\026\022\027\n\023ILLEGAL_METRIC_TY"
"PE\020\027\022\021\n\rOUT_OF_MEMORY\020\030\022\023\n\017INDEX_NOT_EXI"
"ST\020\031\022\024\n\017DD_REQUEST_RACE\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*\225\006\n\007MsgType\022\t"
"\n\005kNone\020\000\022\025\n\021kCreateCollection\020d\022\023\n\017kDro"
"pCollection\020e\022\022\n\016kHasCollection\020f\022\027\n\023kDe"
"scribeCollection\020g\022\024\n\020kShowCollections\020h"
"\022\022\n\016kGetSysConfigs\020i\022\023\n\017kLoadCollection\020"
"j\022\026\n\022kReleaseCollection\020k\022\025\n\020kCreatePart"
"ition\020\310\001\022\023\n\016kDropPartition\020\311\001\022\022\n\rkHasPar"
"tition\020\312\001\022\027\n\022kDescribePartition\020\313\001\022\024\n\017kS"
"howPartitions\020\314\001\022\023\n\016kLoadPartition\020\315\001\022\026\n"
"\021kReleasePartition\020\316\001\022\021\n\014kShowSegment\020\372\001"
"\022\025\n\020kDescribeSegment\020\373\001\022\021\n\014kCreateIndex\020"
"\254\002\022\023\n\016kDescribeIndex\020\255\002\022\017\n\nkDropIndex\020\256\002"
"\022\014\n\007kInsert\020\220\003\022\014\n\007kDelete\020\221\003\022\013\n\006kFlush\020\222"
"\003\022\014\n\007kSearch\020\364\003\022\022\n\rkSearchResult\020\365\003\022\023\n\016k"
"GetIndexState\020\366\003\022\035\n\030kGetCollectionStatis"
"tics\020\367\003\022\034\n\027kGetPartitionStatistics\020\370\003\022\021\n"
"\014kSegmentInfo\020\330\004\022\016\n\tkTimeTick\020\260\t\022\024\n\017kQue"
"ryNodeStats\020\261\t\022\017\n\nkLoadIndex\020\262\t\022\017\n\nkRequ"
"estID\020\263\t\022\020\n\013kRequestTSO\020\264\t\022\025\n\020kAllocateS"
"egment\020\265\t\022\027\n\022kSegmentStatistics\020\266\t\022\026\n\021kS"
"egmentFlushDone\020\267\tBBZ@github.com/zillizt"
"ech/milvus-distributed/internal/proto/co"
"mmonpbb\006proto3"
" \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*\225\006\n\007Msg"
"Type\022\t\n\005kNone\020\000\022\025\n\021kCreateCollection\020d\022\023"
"\n\017kDropCollection\020e\022\022\n\016kHasCollection\020f\022"
"\027\n\023kDescribeCollection\020g\022\024\n\020kShowCollect"
"ions\020h\022\022\n\016kGetSysConfigs\020i\022\023\n\017kLoadColle"
"ction\020j\022\026\n\022kReleaseCollection\020k\022\025\n\020kCrea"
"tePartition\020\310\001\022\023\n\016kDropPartition\020\311\001\022\022\n\rk"
"HasPartition\020\312\001\022\027\n\022kDescribePartition\020\313\001"
"\022\024\n\017kShowPartitions\020\314\001\022\023\n\016kLoadPartition"
"\020\315\001\022\026\n\021kReleasePartition\020\316\001\022\021\n\014kShowSegm"
"ent\020\372\001\022\025\n\020kDescribeSegment\020\373\001\022\021\n\014kCreate"
"Index\020\254\002\022\023\n\016kDescribeIndex\020\255\002\022\017\n\nkDropIn"
"dex\020\256\002\022\014\n\007kInsert\020\220\003\022\014\n\007kDelete\020\221\003\022\013\n\006kF"
"lush\020\222\003\022\014\n\007kSearch\020\364\003\022\022\n\rkSearchResult\020\365"
"\003\022\023\n\016kGetIndexState\020\366\003\022\035\n\030kGetCollection"
"Statistics\020\367\003\022\034\n\027kGetPartitionStatistics"
"\020\370\003\022\021\n\014kSegmentInfo\020\330\004\022\016\n\tkTimeTick\020\260\t\022\024"
"\n\017kQueryNodeStats\020\261\t\022\017\n\nkLoadIndex\020\262\t\022\017\n"
"\nkRequestID\020\263\t\022\020\n\013kRequestTSO\020\264\t\022\025\n\020kAll"
"ocateSegment\020\265\t\022\027\n\022kSegmentStatistics\020\266\t"
"\022\026\n\021kSegmentFlushDone\020\267\tBBZ@github.com/z"
"illiztech/milvus-distributed/internal/pr"
"oto/commonpbb\006proto3"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_common_2eproto_deps[1] = {
};
......@@ -292,7 +299,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", 2134,
&descriptor_table_common_2eproto_initialized, descriptor_table_protodef_common_2eproto, "common.proto", 2420,
&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,
......
......@@ -96,38 +96,38 @@ namespace proto {
namespace common {
enum ErrorCode : int {
SUCCESS = 0,
UNEXPECTED_ERROR = 1,
CONNECT_FAILED = 2,
PERMISSION_DENIED = 3,
COLLECTION_NOT_EXISTS = 4,
ILLEGAL_ARGUMENT = 5,
ILLEGAL_DIMENSION = 7,
ILLEGAL_INDEX_TYPE = 8,
ILLEGAL_COLLECTION_NAME = 9,
ILLEGAL_TOPK = 10,
ILLEGAL_ROWRECORD = 11,
ILLEGAL_VECTOR_ID = 12,
ILLEGAL_SEARCH_RESULT = 13,
FILE_NOT_FOUND = 14,
META_FAILED = 15,
CACHE_FAILED = 16,
CANNOT_CREATE_FOLDER = 17,
CANNOT_CREATE_FILE = 18,
CANNOT_DELETE_FOLDER = 19,
CANNOT_DELETE_FILE = 20,
BUILD_INDEX_ERROR = 21,
ILLEGAL_NLIST = 22,
ILLEGAL_METRIC_TYPE = 23,
OUT_OF_MEMORY = 24,
INDEX_NOT_EXIST = 25,
DD_REQUEST_RACE = 1000,
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,
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 = SUCCESS;
constexpr ErrorCode ErrorCode_MAX = DD_REQUEST_RACE;
constexpr ErrorCode ErrorCode_MIN = ERROR_CODE_SUCCESS;
constexpr ErrorCode ErrorCode_MAX = ERROR_CODE_DD_REQUEST_RACE;
constexpr int ErrorCode_ARRAYSIZE = ErrorCode_MAX + 1;
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ErrorCode_descriptor();
......
......@@ -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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
}
switch {
......@@ -176,7 +176,7 @@ func (node *DataNode) WatchDmChannels(ctx context.Context, in *datapb.WatchDmCha
default:
Params.InsertChannelNames = in.GetChannelNames()
status.ErrorCode = commonpb.ErrorCode_SUCCESS
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
Reason: "",
},
Value: "",
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......@@ -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_SUCCESS}, nil
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}, nil
}
func (c *mockDataNodeClient) FlushSegments(ctx context.Context, in *datapb.FlushSegRequest) (*commonpb.Status, error) {
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}, nil
return &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}, nil
}
func (c *mockDataNodeClient) Stop() error {
......
......@@ -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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
return resp, nil
}
func (s *Server) GetTimeTickChannel(ctx context.Context) (*milvuspb.StringResponse, error) {
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: "server is initializing",
}, nil
}
s.segAllocator.SealAllSegments(req.CollectionID)
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
func (s *Server) AssignSegmentID(ctx context.Context, req *datapb.AssignSegIDRequest) (*datapb.AssignSegIDResponse, error) {
resp := &datapb.AssignSegIDResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
SegIDAssignments: make([]*datapb.SegIDAssignment, 0),
}
if !s.checkStateIsHealthy() {
resp.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_UNEXPECTED_ERROR
state.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
state.Status.Reason = "get segment states error: " + err.Error()
} else {
state.Status.ErrorCode = commonpb.ErrorCode_SUCCESS
state.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
resp.Infos = infos
return resp, nil
}
......@@ -19,11 +19,11 @@ func VerifyResponse(response interface{}, err error) error {
}
switch resp := response.(type) {
case Response:
if resp.GetStatus().ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.GetStatus().ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.GetStatus().Reason)
}
case *commonpb.Status:
if resp.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.Reason)
}
default:
......
......@@ -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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: "DataNode isn't healthy.",
}, errors.New("DataNode is not ready yet")
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, s.datanode.FlushSegments(ctx, in)
}
......@@ -61,7 +61,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......@@ -69,7 +69,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......
......@@ -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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, createCollectionArray[0].Base.MsgType, commonpb.MsgType_kCreateCollection)
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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, len(createCollectionArray), 2)
assert.Equal(t, createCollectionArray[1].Base.MsgType, commonpb.MsgType_kCreateCollection)
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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
collMeta, err := core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 1)
......@@ -617,7 +617,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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, dropCollectionArray[0].Base.MsgType, commonpb.MsgType_kDropCollection)
assert.Equal(t, dropCollectionArray[0].CollectionName, "testColl")
assert.Equal(t, len(collectionMetaCache), 1)
......@@ -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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
})
err = cli.Stop()
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......
......@@ -91,7 +91,7 @@ func (m *MasterServiceMock) DescribeSegment(in *milvuspb.DescribeSegmentRequest)
}
rsp := &milvuspb.DescribeSegmentResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
IndexFilePaths: []string{indexPaths1, indexPaths2},
}
rsp := &indexpb.IndexFilePathsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
InitParams: &internalPb.InitParams{
NodeID: int64(0),
......
......@@ -298,7 +298,7 @@ func (s *Server) GetTimeTickChannel(ctx context.Context, in *commonpb.Empty) (*m
}
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
Value: channel,
}, nil
......@@ -312,7 +312,7 @@ func (s *Server) GetStatsChannel(ctx context.Context, in *commonpb.Empty) (*milv
}
return &milvuspb.StringResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
Value: channel,
}, nil
......
......@@ -85,7 +85,7 @@ func (i *IndexNode) Init() error {
return err2
}
if resp.Status.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.Status.Reason)
}
......@@ -174,12 +174,12 @@ func (i *IndexNode) BuildIndex(ctx context.Context, request *indexpb.BuildIndexC
}
ret := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}
err := i.sched.IndexBuildQueue.Enqueue(t)
if err != nil {
ret.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
ret.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.Reason = err.Error()
return ret, nil
}
......@@ -190,7 +190,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
Reason: "",
}, nil
}
......@@ -217,7 +217,7 @@ func (i *IndexNode) GetComponentStates(ctx context.Context) (*internalpb2.Compon
State: stateInfo,
SubcomponentStates: nil, // todo add subcomponents states
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}
return ret, nil
......@@ -226,7 +226,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......@@ -234,7 +234,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}, nil
}
......@@ -121,14 +121,14 @@ func (it *IndexBuildTask) PostExecute(ctx context.Context) error {
nty := &indexpb.BuildIndexNotification{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
IndexBuildID: it.cmd.IndexBuildID,
NodeID: it.nodeID,
IndexFilePaths: it.savePaths,
}
if it.err != nil {
nty.Status.ErrorCode = commonpb.ErrorCode_BUILD_INDEX_ERROR
nty.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR
}
ctx = context.TODO()
......@@ -138,7 +138,7 @@ func (it *IndexBuildTask) PostExecute(ctx context.Context) error {
return err
}
if resp.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
err = errors.New(resp.Reason)
}
log.Println("[IndexBuildTask][PostExecute] err", err)
......
......@@ -164,7 +164,7 @@ func (i *IndexService) GetComponentStates(ctx context.Context) (*internalpb2.Com
State: stateInfo,
SubcomponentStates: nil, // todo add subcomponents states
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}
return ret, nil
......@@ -173,7 +173,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
Reason: "",
},
Value: "",
......@@ -183,7 +183,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
Reason: "",
},
Value: "",
......@@ -194,7 +194,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
t := &IndexAddTask{
......@@ -229,18 +229,18 @@ func (i *IndexService) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRe
err := fn()
if err != nil {
ret.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.Status.Reason = err.Error()
return ret, nil
}
err = t.WaitToFinish()
if err != nil {
ret.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
ret.Status.Reason = err.Error()
return ret, nil
}
ret.Status.ErrorCode = commonpb.ErrorCode_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
ret.IndexBuildID = t.indexBuildID
return ret, nil
}
......@@ -256,7 +256,7 @@ func (i *IndexService) GetIndexStates(ctx context.Context, req *indexpb.IndexSta
}
ret := &indexpb.IndexStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
States: indexStates,
}
......@@ -269,7 +269,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, nil
}
......@@ -288,7 +288,7 @@ func (i *IndexService) DropIndex(ctx context.Context, req *indexpb.DropIndexRequ
}()
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
......@@ -305,7 +305,7 @@ func (i *IndexService) GetIndexFilePaths(ctx context.Context, req *indexpb.Index
ret := &indexpb.IndexFilePathsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
FilePaths: indexPaths,
}
......@@ -314,11 +314,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}
log.Println("[IndexService][NotifyBuildIndex]", nty.String())
if err := i.metaTable.NotifyBuildIndex(nty); err != nil {
ret.ErrorCode = commonpb.ErrorCode_BUILD_INDEX_ERROR
ret.ErrorCode = commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR
ret.Reason = err.Error()
log.Println("[IndexService][NotifyBuildIndex][metaTable][NotifyBuildIndex]", err)
......
......@@ -113,7 +113,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_SUCCESS {
if nty.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
meta.State = commonpb.IndexState_INDEX_STATE_FAILED
meta.FailReason = nty.Status.Reason
} else {
......
......@@ -60,7 +60,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
......@@ -76,7 +76,7 @@ func (i *IndexService) RegisterNode(ctx context.Context, req *indexpb.RegisterNo
return ret, nil
}
ret.Status.ErrorCode = commonpb.ErrorCode_SUCCESS
ret.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_SUCCESS
params := i.prepareNodeInitParams()
ret.InitParams = &internalpb2.InitParams{
NodeID: nodeID,
......
......@@ -121,7 +121,7 @@ func (it *IndexAddTask) Execute(ctx context.Context) error {
return err
}
log.Println("build index finish, err = ", err)
if resp.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.Reason)
}
it.nodeClients.IncPriority(it.buildClientNodeID, 1)
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
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_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.NotEqual(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_INDEX_NOT_EXIST)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_INDEX_NOT_EXIST)
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_SUCCESS)
assert.Equal(t, rsp.Status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
assert.Equal(t, len(rsp.IndexDescriptions), 1)
assert.Equal(t, rsp.IndexDescriptions[0].IndexName, Params.DefaultIndexName)
})
......@@ -803,7 +803,7 @@ func TestMasterService(t *testing.T) {
rsp, err := core.DropIndex(ctx, req)
assert.Nil(t, err)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_SUCCESS)
assert.Equal(t, rsp.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
im.mutex.Lock()
assert.Equal(t, len(im.idxDropID), 1)
......@@ -832,7 +832,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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
collMeta, err = core.MetaTable.GetCollectionByName("testColl")
assert.Nil(t, err)
assert.Equal(t, len(collMeta.PartitionIDs), 1)
......@@ -864,7 +864,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_SUCCESS)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
msg, ok := <-ddStream.Chan()
assert.True(t, ok)
......@@ -894,7 +894,7 @@ func TestMasterService(t *testing.T) {
}
status, err = core.DropCollection(ctx, req)
assert.Nil(t, err)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_UNEXPECTED_ERROR)
assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR)
time.Sleep(time.Second)
assert.Zero(t, len(ddStream.Chan()))
collArray = pm.GetCollArray()
......
......@@ -111,7 +111,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 1,
SourceID: reqID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
ResultChannelID: "0",
}
searchResultMsg := &msgstream.SearchResultMsg{
......
......@@ -104,7 +104,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg {
Timestamp: 1,
SourceID: reqID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS},
ResultChannelID: "0",
}
searchResultMsg := &msgstream.SearchResultMsg{
......
......@@ -4,34 +4,34 @@ package milvus.proto.common;
option go_package="github.com/zilliztech/milvus-distributed/internal/proto/commonpb";
enum ErrorCode {
SUCCESS = 0;
UNEXPECTED_ERROR = 1;
CONNECT_FAILED = 2;
PERMISSION_DENIED = 3;
COLLECTION_NOT_EXISTS = 4;
ILLEGAL_ARGUMENT = 5;
ILLEGAL_DIMENSION = 7;
ILLEGAL_INDEX_TYPE = 8;
ILLEGAL_COLLECTION_NAME = 9;
ILLEGAL_TOPK = 10;
ILLEGAL_ROWRECORD = 11;
ILLEGAL_VECTOR_ID = 12;
ILLEGAL_SEARCH_RESULT = 13;
FILE_NOT_FOUND = 14;
META_FAILED = 15;
CACHE_FAILED = 16;
CANNOT_CREATE_FOLDER = 17;
CANNOT_CREATE_FILE = 18;
CANNOT_DELETE_FOLDER = 19;
CANNOT_DELETE_FILE = 20;
BUILD_INDEX_ERROR = 21;
ILLEGAL_NLIST = 22;
ILLEGAL_METRIC_TYPE = 23;
OUT_OF_MEMORY = 24;
INDEX_NOT_EXIST = 25;
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;
// internal error code.
DD_REQUEST_RACE = 1000;
ERROR_CODE_DD_REQUEST_RACE = 1000;
}
enum IndexState {
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, nil
}
err = cpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, nil
}
err = dpt.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, nil
}
err = dit.WaitToFinish()
if err != nil {
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS {
if infoResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
}
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_SUCCESS {
if infoResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS
resp.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if describeCollectionResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if showPartitionsResp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if showSegmentResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
Reason: "",
},
}, nil
......
......@@ -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_SUCCESS {
if coll.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if coll.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if partitions.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return 0, fmt.Errorf("%s", partitions.Status.Reason)
}
if len(partitions.PartitionIDs) != len(partitions.PartitionNames) {
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
},
CollectionID: typeutil.UniqueID(0),
Schema: nil,
......
......@@ -91,7 +91,7 @@ func (node *ProxyNode) Init() error {
if err != nil {
return err
}
if response.Status.ErrorCode != commonpb.ErrorCode_SUCCESS {
if response.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.Status.Reason)
}
......
......@@ -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_SUCCESS {
if info.Status.GetErrorCode() != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
log.Debug("proxynode", zap.String("SyncSegment Error", info.Status.Reason))
continue
}
......
......@@ -189,7 +189,7 @@ func (it *InsertTask) Execute(ctx context.Context) error {
it.result = &milvuspb.InsertResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR
it.result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
it.result.Status.Reason = err.Error()
return err
}
err = stream.Produce(ctx, msgPack)
if err != nil {
it.result.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
it.result.Status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_SUCCESS {
if cct.result.ErrorCode == commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if partialSearchResult.Status.ErrorCode == commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if hct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if dct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(result.Status.Reason)
}
g.result = &milvuspb.CollectionStatsResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if sct.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if cpt.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if dpt.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if hpt.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if spt.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if cit.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if dit.result.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if dit.result.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if segments.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if states.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(status.Reason)
}
}
ft.result = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}
return nil
}
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, nil
}
......
......@@ -100,7 +100,7 @@ func (t *RegisterLinkTask) Execute(ctx context.Context) error {
Port: info.port,
},
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(status.Reason)
}
}
t.response = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}
return nil
}
......
......@@ -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_BUILD_INDEX_ERROR}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_BUILD_INDEX_ERROR}
}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}
}
func (s *Segment) dropIndex(fieldID int64) commonpb.Status {
// WARN: Not support yet
return commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS}
return commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS}
}
......@@ -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_SUCCESS {
if response.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return -1, -1, errors.New(response.Status.Reason)
}
return response.IndexID, response.BuildID, nil
......@@ -337,7 +337,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_SUCCESS {
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return nil, err
}
......
......@@ -121,7 +121,7 @@ func (node *QueryNode) Init() error {
if err != nil {
panic(err)
}
if resp.Status.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
}
code, ok := node.stateCode.Load().(internalpb2.StateCode)
if !ok {
errMsg := "unexpected error in type assertion"
stats.Status = &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: errMsg,
}
......@@ -350,7 +350,7 @@ func (node *QueryNode) RemoveQueryChannel(in *queryPb.RemoveQueryChannelsRequest
resultStream.AsProducer(producerChannels)
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
status.Reason = err.Error()
return status, err
}
}
err := node.replica.enablePartition(partitionID)
if err != nil {
status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}
return status, err
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
func (node *QueryNode) ReleasePartitions(in *queryPb.ReleasePartitionRequest) (*commonpb.Status, error) {
status := &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR
status.ErrorCode = commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR
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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
Infos: infos,
}, nil
......
......@@ -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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
InitParams: &internalpb2.InitParams{
NodeID: int64(1),
......
......@@ -304,7 +304,7 @@ func (ss *searchService) search(msg msgstream.TsMsg) error {
Timestamp: searchTimestamp,
SourceID: searchMsg.Base.SourceID,
},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR, Reason: errMsg},
Status: &commonpb.Status{ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR, Reason: errMsg},
ResultChannelID: searchMsg.ResultChannelID,
Hits: [][]byte{},
},
......
......@@ -26,10 +26,10 @@ import (
)
const (
segTypeInvalid = 0
segTypeGrowing = 1
segTypeSealed = 2
segTypeIndexing = 3
segTypeInvalid = iota
segTypeGrowing
segTypeSealed
segTypeIndexing
)
type segmentType = int
......
......@@ -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_SUCCESS {
if err != nil || pathResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if err != nil || statesResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return nil, err
}
if len(statesResponse.States) != 1 {
......
......@@ -56,7 +56,7 @@ func (master *MasterMock) ShowPartitions(ctx context.Context, in *milvuspb.ShowP
}
response := &milvuspb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
Values: []string{"insert-0", "insert-1", "insert-2", "insert-3"},
}, nil
......
......@@ -135,7 +135,7 @@ func (qs *QueryService) GetComponentStates(ctx context.Context) (*internalpb2.Co
}
return &internalpb2.ComponentStates{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if showPartitionResponse.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return showPartitionResponse.Status, err
}
partitionIDs := showPartitionResponse.PartitionIDs
......@@ -333,7 +333,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
......@@ -348,7 +348,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, err
}
......@@ -356,7 +356,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
......@@ -371,14 +371,14 @@ func (qs *QueryService) ShowPartitions(ctx context.Context, req *querypb.ShowPar
if err != nil {
return &querypb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
},
}, err
}
return &querypb.ShowPartitionResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
PartitionIDs: partitionIDs,
}, nil
......@@ -394,12 +394,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}
}
return &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}
}
log.Debug("load partitions start", zap.String("partitionIDs", fmt.Sprintln(partitionIDs)))
......@@ -514,7 +514,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
......@@ -544,7 +544,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_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
}, err
}
......@@ -553,7 +553,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_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
}, nil
}
......@@ -584,7 +584,7 @@ func (qs *QueryService) CreateQueryChannel(ctx context.Context) (*querypb.Create
qs.qcMutex.Unlock()
return &querypb.CreateQueryChannelResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
},
}, err
......@@ -594,7 +594,7 @@ func (qs *QueryService) CreateQueryChannel(ctx context.Context) (*querypb.Create
return &querypb.CreateQueryChannelResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
RequestChannel: allocatedQueryChannel,
ResultChannel: allocatedQueryResultChannel,
......@@ -606,7 +606,7 @@ func (qs *QueryService) GetPartitionStates(ctx context.Context, req *querypb.Par
if err != nil {
return &querypb.PartitionStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
},
PartitionDescriptions: states,
......@@ -614,7 +614,7 @@ func (qs *QueryService) GetPartitionStates(ctx context.Context, req *querypb.Par
}
return &querypb.PartitionStatesResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
PartitionDescriptions: states,
}, nil
......@@ -627,7 +627,7 @@ func (qs *QueryService) GetSegmentInfo(ctx context.Context, req *querypb.Segment
if err != nil {
return &querypb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UNEXPECTED_ERROR,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_UNEXPECTED_ERROR,
Reason: err.Error(),
},
}, err
......@@ -636,7 +636,7 @@ func (qs *QueryService) GetSegmentInfo(ctx context.Context, req *querypb.Segment
}
return &querypb.SegmentInfoResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
ErrorCode: commonpb.ErrorCode_ERROR_CODE_SUCCESS,
},
Infos: segmentInfos,
}, nil
......
......@@ -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_SUCCESS)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_ERROR_CODE_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_SUCCESS)
assert.Equal(t, response.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS)
})
}
......@@ -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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_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_SUCCESS {
if errCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
msg := C.GoString(st.error_msg)
defer C.free(unsafe.Pointer(st.error_msg))
return nil, 0, errors.New(msg)
......
......@@ -55,7 +55,7 @@ func WaitForComponentStates(ctx context.Context, service StateComponent, service
return err
}
if resp.Status.ErrorCode != commonpb.ErrorCode_SUCCESS {
if resp.Status.ErrorCode != commonpb.ErrorCode_ERROR_CODE_SUCCESS {
return errors.New(resp.Status.Reason)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册