From 7b2d67242d4821d03525eb323cf59c23f08b95f4 Mon Sep 17 00:00:00 2001 From: neza2017 <yefu.chen@zilliz.com> Date: Wed, 10 Mar 2021 14:45:35 +0800 Subject: [PATCH] Fix describe segment if index not exist Signed-off-by: neza2017 <yefu.chen@zilliz.com> --- internal/allocator/id.go | 2 +- internal/allocator/timestamp.go | 2 +- internal/core/src/pb/common.pb.cc | 47 +- internal/core/src/pb/common.pb.h | 80 ++-- internal/datanode/allocator.go | 2 +- internal/datanode/data_node.go | 2 +- internal/datanode/data_node_test.go | 4 +- internal/datanode/data_sync_service_test.go | 2 +- internal/datanode/flow_graph_dd_node.go | 8 +- internal/datanode/flow_graph_dd_node_test.go | 8 +- .../datanode/flow_graph_filter_dm_node.go | 2 +- .../datanode/flow_graph_insert_buffer_node.go | 6 +- internal/datanode/meta_service.go | 4 +- internal/dataservice/allocator.go | 4 +- internal/dataservice/cluster.go | 2 +- internal/dataservice/dd_handler.go | 8 +- internal/dataservice/server.go | 12 +- internal/dataservice/watcher.go | 2 +- internal/dataservice/watcher_test.go | 2 +- .../masterservice/masterservice_test.go | 42 +- internal/masterservice/master_service.go | 13 +- internal/masterservice/master_service_test.go | 46 +- internal/masterservice/meta_table.go | 40 +- internal/masterservice/task.go | 2 +- internal/msgstream/pulsarms/msg_test.go | 8 +- .../msgstream/pulsarms/pulsar_msgstream.go | 12 +- .../pulsarms/pulsar_msgstream_test.go | 82 ++-- internal/msgstream/rmqms/rmq_msgstream.go | 12 +- .../msgstream/rmqms/rmq_msgstream_test.go | 56 +-- internal/msgstream/unmarshal.go | 30 +- internal/msgstream/unmarshal_test.go | 2 +- internal/msgstream/util/repack_func.go | 8 +- internal/proto/common.proto | 106 ++--- internal/proto/commonpb/common.pb.go | 407 +++++++++--------- internal/proxynode/impl.go | 14 +- internal/proxynode/meta_cache.go | 6 +- internal/proxynode/repack_func.go | 4 +- internal/proxynode/task.go | 76 ++-- internal/proxynode/timetick.go | 2 +- internal/proxyservice/timetick.go | 2 +- internal/querynode/data_sync_service_test.go | 4 +- .../querynode/flow_graph_filter_dm_node.go | 2 +- .../querynode/flow_graph_service_time_node.go | 2 +- internal/querynode/index_loader.go | 2 +- internal/querynode/load_service_test.go | 6 +- internal/querynode/query_node.go | 2 +- internal/querynode/search_service.go | 6 +- internal/querynode/search_service_test.go | 12 +- internal/querynode/stats_service.go | 2 +- internal/queryservice/queryservice.go | 4 +- internal/timesync/time_sync_producer.go | 2 +- internal/util/trace/util.go | 6 +- 52 files changed, 630 insertions(+), 589 deletions(-) diff --git a/internal/allocator/id.go b/internal/allocator/id.go index 9621f3d32..e62dc3863 100644 --- a/internal/allocator/id.go +++ b/internal/allocator/id.go @@ -84,7 +84,7 @@ func (ia *IDAllocator) syncID() bool { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) req := &masterpb.IDRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kRequestID, + MsgType: commonpb.MsgType_RequestID, MsgID: 0, Timestamp: 0, SourceID: ia.PeerID, diff --git a/internal/allocator/timestamp.go b/internal/allocator/timestamp.go index c37ade8d7..1b8b5207e 100644 --- a/internal/allocator/timestamp.go +++ b/internal/allocator/timestamp.go @@ -104,7 +104,7 @@ func (ta *TimestampAllocator) syncTs() bool { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) req := &masterpb.TsoRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kRequestTSO, + MsgType: commonpb.MsgType_RequestTSO, MsgID: 0, Timestamp: 0, SourceID: ta.PeerID, diff --git a/internal/core/src/pb/common.pb.cc b/internal/core/src/pb/common.pb.cc index 1a20a87bc..a605bc498 100644 --- a/internal/core/src/pb/common.pb.cc +++ b/internal/core/src/pb/common.pb.cc @@ -261,29 +261,28 @@ const char descriptor_table_protodef_common_2eproto[] PROTOBUF_SECTION_VARIABLE( "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" + "mentSealed\020\003\022\022\n\016SegmentFlushed\020\004*\365\005\n\007Msg" + "Type\022\010\n\004None\020\000\022\024\n\020CreateCollection\020d\022\022\n\016" + "DropCollection\020e\022\021\n\rHasCollection\020f\022\026\n\022D" + "escribeCollection\020g\022\023\n\017ShowCollections\020h" + "\022\024\n\020GetSystemConfigs\020i\022\022\n\016LoadCollection" + "\020j\022\025\n\021ReleaseCollection\020k\022\024\n\017CreateParti" + "tion\020\310\001\022\022\n\rDropPartition\020\311\001\022\021\n\014HasPartit" + "ion\020\312\001\022\026\n\021DescribePartition\020\313\001\022\023\n\016ShowPa" + "rtitions\020\314\001\022\023\n\016LoadPartitions\020\315\001\022\026\n\021Rele" + "asePartitions\020\316\001\022\021\n\014ShowSegments\020\372\001\022\024\n\017D" + "escribeSegment\020\373\001\022\020\n\013CreateIndex\020\254\002\022\022\n\rD" + "escribeIndex\020\255\002\022\016\n\tDropIndex\020\256\002\022\013\n\006Inser" + "t\020\220\003\022\013\n\006Delete\020\221\003\022\n\n\005Flush\020\222\003\022\013\n\006Search\020" + "\364\003\022\021\n\014SearchResult\020\365\003\022\022\n\rGetIndexState\020\366" + "\003\022\034\n\027GetCollectionStatistics\020\367\003\022\033\n\026GetPa" + "rtitionStatistics\020\370\003\022\020\n\013SegmentInfo\020\330\004\022\r" + "\n\010TimeTick\020\260\t\022\023\n\016QueryNodeStats\020\261\t\022\016\n\tLo" + "adIndex\020\262\t\022\016\n\tRequestID\020\263\t\022\017\n\nRequestTSO" + "\020\264\t\022\024\n\017AllocateSegment\020\265\t\022\026\n\021SegmentStat" + "istics\020\266\t\022\025\n\020SegmentFlushDone\020\267\tBBZ@gith" + "ub.com/zilliztech/milvus-distributed/int" + "ernal/proto/commonpbb\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_common_2eproto_deps[1] = { }; @@ -299,7 +298,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", 2420, + &descriptor_table_common_2eproto_initialized, descriptor_table_protodef_common_2eproto, "common.proto", 2388, &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, diff --git a/internal/core/src/pb/common.pb.h b/internal/core/src/pb/common.pb.h index 072bc6478..40104ed65 100644 --- a/internal/core/src/pb/common.pb.h +++ b/internal/core/src/pb/common.pb.h @@ -202,50 +202,50 @@ inline bool SegmentState_Parse( SegmentState_descriptor(), name, value); } enum MsgType : int { - kNone = 0, - kCreateCollection = 100, - kDropCollection = 101, - kHasCollection = 102, - kDescribeCollection = 103, - kShowCollections = 104, - kGetSysConfigs = 105, - kLoadCollection = 106, - kReleaseCollection = 107, - kCreatePartition = 200, - kDropPartition = 201, - kHasPartition = 202, - kDescribePartition = 203, - kShowPartitions = 204, - kLoadPartition = 205, - kReleasePartition = 206, - kShowSegment = 250, - kDescribeSegment = 251, - kCreateIndex = 300, - kDescribeIndex = 301, - kDropIndex = 302, - kInsert = 400, - kDelete = 401, - kFlush = 402, - kSearch = 500, - kSearchResult = 501, - kGetIndexState = 502, - kGetCollectionStatistics = 503, - kGetPartitionStatistics = 504, - kSegmentInfo = 600, - kTimeTick = 1200, - kQueryNodeStats = 1201, - kLoadIndex = 1202, - kRequestID = 1203, - kRequestTSO = 1204, - kAllocateSegment = 1205, - kSegmentStatistics = 1206, - kSegmentFlushDone = 1207, + None = 0, + CreateCollection = 100, + DropCollection = 101, + HasCollection = 102, + DescribeCollection = 103, + ShowCollections = 104, + GetSystemConfigs = 105, + LoadCollection = 106, + ReleaseCollection = 107, + CreatePartition = 200, + DropPartition = 201, + HasPartition = 202, + DescribePartition = 203, + ShowPartitions = 204, + LoadPartitions = 205, + ReleasePartitions = 206, + ShowSegments = 250, + DescribeSegment = 251, + CreateIndex = 300, + DescribeIndex = 301, + DropIndex = 302, + Insert = 400, + Delete = 401, + Flush = 402, + Search = 500, + SearchResult = 501, + GetIndexState = 502, + GetCollectionStatistics = 503, + GetPartitionStatistics = 504, + SegmentInfo = 600, + TimeTick = 1200, + QueryNodeStats = 1201, + LoadIndex = 1202, + RequestID = 1203, + RequestTSO = 1204, + AllocateSegment = 1205, + SegmentStatistics = 1206, + SegmentFlushDone = 1207, MsgType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), MsgType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool MsgType_IsValid(int value); -constexpr MsgType MsgType_MIN = kNone; -constexpr MsgType MsgType_MAX = kSegmentFlushDone; +constexpr MsgType MsgType_MIN = None; +constexpr MsgType MsgType_MAX = SegmentFlushDone; constexpr int MsgType_ARRAYSIZE = MsgType_MAX + 1; const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MsgType_descriptor(); diff --git a/internal/datanode/allocator.go b/internal/datanode/allocator.go index 1619c516e..fa4d23795 100644 --- a/internal/datanode/allocator.go +++ b/internal/datanode/allocator.go @@ -26,7 +26,7 @@ func (alloc *allocator) allocID() (UniqueID, error) { ctx := context.TODO() resp, err := alloc.masterService.AllocID(ctx, &masterpb.IDRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kRequestID, + MsgType: commonpb.MsgType_RequestID, MsgID: 1, // GOOSE TODO Timestamp: 0, // GOOSE TODO SourceID: Params.NodeID, diff --git a/internal/datanode/data_node.go b/internal/datanode/data_node.go index 5281c4ab9..3100837a5 100644 --- a/internal/datanode/data_node.go +++ b/internal/datanode/data_node.go @@ -95,7 +95,7 @@ func (node *DataNode) Init() error { req := &datapb.RegisterNodeRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kNone, + MsgType: commonpb.MsgType_None, SourceID: node.NodeID, }, Address: &commonpb.Address{ diff --git a/internal/datanode/data_node_test.go b/internal/datanode/data_node_test.go index 9868daebb..8ac5aa30d 100644 --- a/internal/datanode/data_node_test.go +++ b/internal/datanode/data_node_test.go @@ -339,7 +339,7 @@ func (df *DataFactory) GetMsgStreamTsInsertMsgs(n int) (inMsgs []msgstream.TsMsg }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 0, // GOOSE TODO Timestamp: Timestamp(i + 1000), SourceID: 0, @@ -367,7 +367,7 @@ func (df *DataFactory) GetMsgStreamInsertMsgs(n int) (inMsgs []*msgstream.Insert }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 0, // GOOSE TODO Timestamp: Timestamp(i + 1000), SourceID: 0, diff --git a/internal/datanode/data_sync_service_test.go b/internal/datanode/data_sync_service_test.go index 7e1998820..ddf334c12 100644 --- a/internal/datanode/data_sync_service_test.go +++ b/internal/datanode/data_sync_service_test.go @@ -74,7 +74,7 @@ func TestDataSyncService_Start(t *testing.T) { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: UniqueID(0), Timestamp: math.MaxUint64, SourceID: 0, diff --git a/internal/datanode/flow_graph_dd_node.go b/internal/datanode/flow_graph_dd_node.go index 48b30481d..05ea49350 100644 --- a/internal/datanode/flow_graph_dd_node.go +++ b/internal/datanode/flow_graph_dd_node.go @@ -104,13 +104,13 @@ func (ddNode *ddNode) Operate(ctx context.Context, in []Msg) ([]Msg, context.Con // do dd tasks for _, msg := range tsMessages { switch msg.Type() { - case commonpb.MsgType_kCreateCollection: + case commonpb.MsgType_CreateCollection: ddNode.createCollection(msg.(*msgstream.CreateCollectionMsg)) - case commonpb.MsgType_kDropCollection: + case commonpb.MsgType_DropCollection: ddNode.dropCollection(msg.(*msgstream.DropCollectionMsg)) - case commonpb.MsgType_kCreatePartition: + case commonpb.MsgType_CreatePartition: ddNode.createPartition(msg.(*msgstream.CreatePartitionMsg)) - case commonpb.MsgType_kDropPartition: + case commonpb.MsgType_DropPartition: ddNode.dropPartition(msg.(*msgstream.DropPartitionMsg)) default: log.Error("Not supporting message type", zap.Any("Type", msg.Type())) diff --git a/internal/datanode/flow_graph_dd_node_test.go b/internal/datanode/flow_graph_dd_node_test.go index 05d17052c..afdb4f3d5 100644 --- a/internal/datanode/flow_graph_dd_node_test.go +++ b/internal/datanode/flow_graph_dd_node_test.go @@ -45,7 +45,7 @@ func TestFlowGraphDDNode_Operate(t *testing.T) { // create collection createCollReq := internalpb2.CreateCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreateCollection, + MsgType: commonpb.MsgType_CreateCollection, MsgID: 1, Timestamp: 1, SourceID: 1, @@ -68,7 +68,7 @@ func TestFlowGraphDDNode_Operate(t *testing.T) { // drop collection dropCollReq := internalpb2.DropCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropCollection, + MsgType: commonpb.MsgType_DropCollection, MsgID: 2, Timestamp: 2, SourceID: 2, @@ -92,7 +92,7 @@ func TestFlowGraphDDNode_Operate(t *testing.T) { // create partition createPartitionReq := internalpb2.CreatePartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreatePartition, + MsgType: commonpb.MsgType_CreatePartition, MsgID: 3, Timestamp: 3, SourceID: 3, @@ -116,7 +116,7 @@ func TestFlowGraphDDNode_Operate(t *testing.T) { // drop partition dropPartitionReq := internalpb2.DropPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropPartition, + MsgType: commonpb.MsgType_DropPartition, MsgID: 4, Timestamp: 4, SourceID: 4, diff --git a/internal/datanode/flow_graph_filter_dm_node.go b/internal/datanode/flow_graph_filter_dm_node.go index 5e2ac9ca0..33c503dd5 100644 --- a/internal/datanode/flow_graph_filter_dm_node.go +++ b/internal/datanode/flow_graph_filter_dm_node.go @@ -56,7 +56,7 @@ func (fdmNode *filterDmNode) Operate(ctx context.Context, in []Msg) ([]Msg, cont for _, msg := range msgStreamMsg.TsMessages() { switch msg.Type() { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: resMsg := fdmNode.filterInvalidInsertMessage(msg.(*msgstream.InsertMsg)) if resMsg != nil { iMsg.insertMessages = append(iMsg.insertMessages, resMsg) diff --git a/internal/datanode/flow_graph_insert_buffer_node.go b/internal/datanode/flow_graph_insert_buffer_node.go index 763801e4d..2f4179a8f 100644 --- a/internal/datanode/flow_graph_insert_buffer_node.go +++ b/internal/datanode/flow_graph_insert_buffer_node.go @@ -537,7 +537,7 @@ func (ibNode *insertBufferNode) completeFlush(segID UniqueID) error { msgPack := msgstream.MsgPack{} completeFlushMsg := internalpb2.SegmentFlushCompletedMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentFlushDone, + MsgType: commonpb.MsgType_SegmentFlushDone, MsgID: 0, // GOOSE TODO Timestamp: 0, // GOOSE TODO SourceID: Params.NodeID, @@ -565,7 +565,7 @@ func (ibNode *insertBufferNode) writeHardTimeTick(ts Timestamp) error { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, // GOOSE TODO Timestamp: ts, // GOOSE TODO SourceID: Params.NodeID, @@ -592,7 +592,7 @@ func (ibNode *insertBufferNode) updateSegStatistics(segIDs []UniqueID, currentPo segStats := internalpb2.SegmentStatistics{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentStatistics, + MsgType: commonpb.MsgType_SegmentStatistics, MsgID: UniqueID(0), // GOOSE TODO Timestamp: Timestamp(0), // GOOSE TODO SourceID: Params.NodeID, diff --git a/internal/datanode/meta_service.go b/internal/datanode/meta_service.go index f31950b3f..73825633b 100644 --- a/internal/datanode/meta_service.go +++ b/internal/datanode/meta_service.go @@ -56,7 +56,7 @@ func (mService *metaService) loadCollections(ctx context.Context) error { func (mService *metaService) getCollectionNames(ctx context.Context) ([]string, error) { req := &milvuspb.ShowCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: 0, //GOOSE TODO Timestamp: 0, // GOOSE TODO SourceID: Params.NodeID, @@ -75,7 +75,7 @@ func (mService *metaService) createCollection(ctx context.Context, name string) log.Debug("Describing collections") req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: 0, //GOOSE TODO Timestamp: 0, // GOOSE TODO SourceID: Params.NodeID, diff --git a/internal/dataservice/allocator.go b/internal/dataservice/allocator.go index becf129cb..14879c87e 100644 --- a/internal/dataservice/allocator.go +++ b/internal/dataservice/allocator.go @@ -28,7 +28,7 @@ func (allocator *allocator) allocTimestamp() (Timestamp, error) { ctx := context.TODO() resp, err := allocator.masterClient.AllocTimestamp(ctx, &masterpb.TsoRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: -1, // todo add msg id Timestamp: 0, // todo SourceID: Params.NodeID, @@ -45,7 +45,7 @@ func (allocator *allocator) allocID() (UniqueID, error) { ctx := context.TODO() resp, err := allocator.masterClient.AllocID(ctx, &masterpb.IDRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: -1, // todo add msg id Timestamp: 0, // todo SourceID: Params.NodeID, diff --git a/internal/dataservice/cluster.go b/internal/dataservice/cluster.go index 90ef63437..361f3260c 100644 --- a/internal/dataservice/cluster.go +++ b/internal/dataservice/cluster.go @@ -92,7 +92,7 @@ func (c *dataNodeCluster) WatchInsertChannels(channels []string) { for i, group := range groups { resp, err := c.nodes[i].client.WatchDmChannels(ctx, &datapb.WatchDmChannelRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: -1, // todo Timestamp: 0, // todo SourceID: Params.NodeID, diff --git a/internal/dataservice/dd_handler.go b/internal/dataservice/dd_handler.go index 9425224d8..644fff1dd 100644 --- a/internal/dataservice/dd_handler.go +++ b/internal/dataservice/dd_handler.go @@ -22,16 +22,16 @@ func newDDHandler(meta *meta, allocator segmentAllocatorInterface) *ddHandler { func (handler *ddHandler) HandleDDMsg(msg msgstream.TsMsg) error { switch msg.Type() { - case commonpb.MsgType_kCreateCollection: + case commonpb.MsgType_CreateCollection: realMsg := msg.(*msgstream.CreateCollectionMsg) return handler.handleCreateCollection(realMsg) - case commonpb.MsgType_kDropCollection: + case commonpb.MsgType_DropCollection: realMsg := msg.(*msgstream.DropCollectionMsg) return handler.handleDropCollection(realMsg) - case commonpb.MsgType_kCreatePartition: + case commonpb.MsgType_CreatePartition: realMsg := msg.(*msgstream.CreatePartitionMsg) return handler.handleCreatePartition(realMsg) - case commonpb.MsgType_kDropPartition: + case commonpb.MsgType_DropPartition: realMsg := msg.(*msgstream.DropPartitionMsg) return handler.handleDropPartition(realMsg) default: diff --git a/internal/dataservice/server.go b/internal/dataservice/server.go index 9a7b3af77..ab7294369 100644 --- a/internal/dataservice/server.go +++ b/internal/dataservice/server.go @@ -204,7 +204,7 @@ func (s *Server) loadMetaFromMaster() error { } collections, err := s.masterClient.ShowCollections(ctx, &milvuspb.ShowCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: -1, // todo add msg id Timestamp: 0, // todo SourceID: Params.NodeID, @@ -217,7 +217,7 @@ func (s *Server) loadMetaFromMaster() error { for _, collectionName := range collections.CollectionNames { collection, err := s.masterClient.DescribeCollection(ctx, &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: -1, // todo Timestamp: 0, // todo SourceID: Params.NodeID, @@ -231,7 +231,7 @@ func (s *Server) loadMetaFromMaster() error { } partitions, err := s.masterClient.ShowPartitions(ctx, &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, MsgID: -1, // todo Timestamp: 0, // todo SourceID: Params.NodeID, @@ -338,7 +338,7 @@ func (s *Server) startSegmentFlushChannel(ctx context.Context) { } msgPack, _ := flushStream.Consume() for _, msg := range msgPack.Msgs { - if msg.Type() != commonpb.MsgType_kSegmentFlushDone { + if msg.Type() != commonpb.MsgType_SegmentFlushDone { continue } realMsg := msg.(*msgstream.FlushCompletedMsg) @@ -576,7 +576,7 @@ func (s *Server) loadCollectionFromMaster(collectionID int64) error { ctx := context.TODO() resp, err := s.masterClient.DescribeCollection(ctx, &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, SourceID: Params.NodeID, }, DbName: "", @@ -613,7 +613,7 @@ func (s *Server) openNewSegment(collectionID UniqueID, partitionID UniqueID, cha }, SegmentMsg: datapb.SegmentMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentInfo, + MsgType: commonpb.MsgType_SegmentInfo, MsgID: 0, Timestamp: 0, SourceID: Params.NodeID, diff --git a/internal/dataservice/watcher.go b/internal/dataservice/watcher.go index b150177fd..5eaca2192 100644 --- a/internal/dataservice/watcher.go +++ b/internal/dataservice/watcher.go @@ -98,7 +98,7 @@ func (watcher *dataNodeTimeTickWatcher) handleTimeTickMsg(msg *msgstream.TimeTic } watcher.cluster.FlushSegment(&datapb.FlushSegRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kFlush, + MsgType: commonpb.MsgType_Flush, MsgID: -1, // todo add msg id Timestamp: 0, // todo SourceID: Params.NodeID, diff --git a/internal/dataservice/watcher_test.go b/internal/dataservice/watcher_test.go index 11e8fbe5f..64e322bc2 100644 --- a/internal/dataservice/watcher_test.go +++ b/internal/dataservice/watcher_test.go @@ -84,7 +84,7 @@ func TestDataNodeTTWatcher(t *testing.T) { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, Timestamp: ts, }, }, diff --git a/internal/distributed/masterservice/masterservice_test.go b/internal/distributed/masterservice/masterservice_test.go index a2289afbb..782fd80e0 100644 --- a/internal/distributed/masterservice/masterservice_test.go +++ b/internal/distributed/masterservice/masterservice_test.go @@ -186,7 +186,7 @@ func TestGrpcService(t *testing.T) { req := &milvuspb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreateCollection, + MsgType: commonpb.MsgType_CreateCollection, MsgID: 100, Timestamp: 100, SourceID: 100, @@ -201,7 +201,7 @@ func TestGrpcService(t *testing.T) { assert.Equal(t, len(createCollectionArray), 1) 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].Base.MsgType, commonpb.MsgType_CreateCollection) assert.Equal(t, createCollectionArray[0].CollectionName, "testColl") req.Base.MsgID = 101 @@ -230,7 +230,7 @@ func TestGrpcService(t *testing.T) { assert.Nil(t, err) 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].Base.MsgType, commonpb.MsgType_CreateCollection) assert.Equal(t, createCollectionArray[1].CollectionName, "testColl-again") //time stamp go back @@ -253,7 +253,7 @@ func TestGrpcService(t *testing.T) { t.Run("has collection", func(t *testing.T) { req := &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 110, Timestamp: 110, SourceID: 110, @@ -268,7 +268,7 @@ func TestGrpcService(t *testing.T) { req = &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 111, Timestamp: 111, SourceID: 111, @@ -284,7 +284,7 @@ func TestGrpcService(t *testing.T) { // test time stamp go back req = &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 111, Timestamp: 111, SourceID: 111, @@ -303,7 +303,7 @@ func TestGrpcService(t *testing.T) { assert.Nil(t, err) req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: 120, Timestamp: 120, SourceID: 120, @@ -321,7 +321,7 @@ func TestGrpcService(t *testing.T) { t.Run("show collection", func(t *testing.T) { req := &milvuspb.ShowCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: 130, Timestamp: 130, SourceID: 130, @@ -338,7 +338,7 @@ func TestGrpcService(t *testing.T) { t.Run("create partition", func(t *testing.T) { req := &milvuspb.CreatePartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreatePartition, + MsgType: commonpb.MsgType_CreatePartition, MsgID: 140, Timestamp: 140, SourceID: 140, @@ -362,7 +362,7 @@ func TestGrpcService(t *testing.T) { t.Run("has partition", func(t *testing.T) { req := &milvuspb.HasPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasPartition, + MsgType: commonpb.MsgType_HasPartition, MsgID: 150, Timestamp: 150, SourceID: 150, @@ -382,7 +382,7 @@ func TestGrpcService(t *testing.T) { assert.Nil(t, err) req := &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, MsgID: 160, Timestamp: 160, SourceID: 160, @@ -418,7 +418,7 @@ func TestGrpcService(t *testing.T) { req := &milvuspb.ShowSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowSegment, + MsgType: commonpb.MsgType_ShowSegments, MsgID: 170, Timestamp: 170, SourceID: 170, @@ -436,7 +436,7 @@ func TestGrpcService(t *testing.T) { t.Run("create index", func(t *testing.T) { req := &milvuspb.CreateIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreateIndex, + MsgType: commonpb.MsgType_CreateIndex, MsgID: 180, Timestamp: 180, SourceID: 180, @@ -478,7 +478,7 @@ func TestGrpcService(t *testing.T) { req := &milvuspb.DescribeSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeSegment, + MsgType: commonpb.MsgType_DescribeSegment, MsgID: 190, Timestamp: 190, SourceID: 190, @@ -495,7 +495,7 @@ func TestGrpcService(t *testing.T) { t.Run("describe index", func(t *testing.T) { req := &milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: 200, Timestamp: 200, SourceID: 200, @@ -534,7 +534,7 @@ func TestGrpcService(t *testing.T) { req := &milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: 210, Timestamp: 210, SourceID: 210, @@ -555,7 +555,7 @@ func TestGrpcService(t *testing.T) { t.Run("drop index", func(t *testing.T) { req := &milvuspb.DropIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropIndex, + MsgType: commonpb.MsgType_DropIndex, MsgID: 215, Timestamp: 215, SourceID: 215, @@ -582,7 +582,7 @@ func TestGrpcService(t *testing.T) { t.Run("drop partition", func(t *testing.T) { req := &milvuspb.DropPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropPartition, + MsgType: commonpb.MsgType_DropPartition, MsgID: 220, Timestamp: 220, SourceID: 220, @@ -605,7 +605,7 @@ func TestGrpcService(t *testing.T) { t.Run("drop collection", func(t *testing.T) { req := &milvuspb.DropCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropCollection, + MsgType: commonpb.MsgType_DropCollection, MsgID: 230, Timestamp: 230, SourceID: 230, @@ -618,14 +618,14 @@ func TestGrpcService(t *testing.T) { assert.Nil(t, err) assert.Equal(t, len(dropCollectionArray), 1) assert.Equal(t, status.ErrorCode, commonpb.ErrorCode_ERROR_CODE_SUCCESS) - assert.Equal(t, dropCollectionArray[0].Base.MsgType, commonpb.MsgType_kDropCollection) + assert.Equal(t, dropCollectionArray[0].Base.MsgType, commonpb.MsgType_DropCollection) assert.Equal(t, dropCollectionArray[0].CollectionName, "testColl") assert.Equal(t, len(collectionMetaCache), 1) assert.Equal(t, collectionMetaCache[0], "testColl") req = &milvuspb.DropCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropCollection, + MsgType: commonpb.MsgType_DropCollection, MsgID: 231, Timestamp: 231, SourceID: 231, diff --git a/internal/masterservice/master_service.go b/internal/masterservice/master_service.go index 460dfb876..4fa6a215b 100644 --- a/internal/masterservice/master_service.go +++ b/internal/masterservice/master_service.go @@ -323,11 +323,16 @@ func (c *Core) startSegmentFlushCompletedLoop() { if !ok { log.Debug("data node segment flush completed chan has colsed, exit loop") } + log.Debug("flush segment", zap.Int64("id", seg)) coll, err := c.MetaTable.GetCollectionBySegmentID(seg) if err != nil { - log.Warn("GetCollectionBySegmentID", zap.String("error", err.Error())) + log.Warn("GetCollectionBySegmentID error", zap.Error(err)) break } + err = c.MetaTable.AddFlushedSegment(seg) + if err != nil { + log.Warn("AddFlushedSegment error", zap.Error(err)) + } for _, f := range coll.FieldIndexes { idxInfo, err := c.MetaTable.GetIndexByID(f.IndexID) if err != nil { @@ -343,7 +348,7 @@ func (c *Core) startSegmentFlushCompletedLoop() { indexName: idxInfo.IndexName, indexID: idxInfo.IndexID, fieldSchema: fieldSch, - indexParams: nil, + indexParams: idxInfo.IndexParams, } c.indexTaskQueue <- t } @@ -428,7 +433,7 @@ func (c *Core) setMsgStreams() error { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: t, SourceID: int64(Params.NodeID), @@ -725,7 +730,7 @@ func (c *Core) SetQueryService(ctx context.Context, s types.QueryService) error c.ReleaseCollection = func(ts typeutil.Timestamp, dbID typeutil.UniqueID, collectionID typeutil.UniqueID) error { req := &querypb.ReleaseCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kReleaseCollection, + MsgType: commonpb.MsgType_ReleaseCollection, MsgID: 0, //TODO, msg ID Timestamp: ts, SourceID: int64(Params.NodeID), diff --git a/internal/masterservice/master_service_test.go b/internal/masterservice/master_service_test.go index 9015db36f..c1fe05445 100644 --- a/internal/masterservice/master_service_test.go +++ b/internal/masterservice/master_service_test.go @@ -262,7 +262,7 @@ func TestMasterService(t *testing.T) { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: timeTick, SourceID: 0, @@ -318,7 +318,7 @@ func TestMasterService(t *testing.T) { req := &milvuspb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreateCollection, + MsgType: commonpb.MsgType_CreateCollection, MsgID: 100, Timestamp: 100, SourceID: 100, @@ -394,7 +394,7 @@ func TestMasterService(t *testing.T) { t.Run("has collection", func(t *testing.T) { req := &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 110, Timestamp: 110, SourceID: 110, @@ -409,7 +409,7 @@ func TestMasterService(t *testing.T) { req = &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 111, Timestamp: 111, SourceID: 111, @@ -425,7 +425,7 @@ func TestMasterService(t *testing.T) { // test time stamp go back req = &milvuspb.HasCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasCollection, + MsgType: commonpb.MsgType_HasCollection, MsgID: 111, Timestamp: 111, SourceID: 111, @@ -444,7 +444,7 @@ func TestMasterService(t *testing.T) { assert.Nil(t, err) req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: 120, Timestamp: 120, SourceID: 120, @@ -463,7 +463,7 @@ func TestMasterService(t *testing.T) { t.Run("show collection", func(t *testing.T) { req := &milvuspb.ShowCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowCollections, + MsgType: commonpb.MsgType_ShowCollections, MsgID: 130, Timestamp: 130, SourceID: 130, @@ -480,7 +480,7 @@ func TestMasterService(t *testing.T) { t.Run("create partition", func(t *testing.T) { req := &milvuspb.CreatePartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreatePartition, + MsgType: commonpb.MsgType_CreatePartition, MsgID: 140, Timestamp: 140, SourceID: 140, @@ -512,7 +512,7 @@ func TestMasterService(t *testing.T) { t.Run("has partition", func(t *testing.T) { req := &milvuspb.HasPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kHasPartition, + MsgType: commonpb.MsgType_HasPartition, MsgID: 150, Timestamp: 150, SourceID: 150, @@ -532,7 +532,7 @@ func TestMasterService(t *testing.T) { assert.Nil(t, err) req := &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowCollections, MsgID: 160, Timestamp: 160, SourceID: 160, @@ -572,7 +572,7 @@ func TestMasterService(t *testing.T) { BaseMsg: baseMsg, SegmentMsg: datapb.SegmentMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentInfo, + MsgType: commonpb.MsgType_SegmentInfo, MsgID: 0, Timestamp: 0, SourceID: 0, @@ -591,7 +591,7 @@ func TestMasterService(t *testing.T) { req := &milvuspb.ShowSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowSegment, + MsgType: commonpb.MsgType_ShowSegments, MsgID: 170, Timestamp: 170, SourceID: 170, @@ -609,7 +609,7 @@ func TestMasterService(t *testing.T) { t.Run("create index", func(t *testing.T) { req := &milvuspb.CreateIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreateIndex, + MsgType: commonpb.MsgType_CreateIndex, MsgID: 180, Timestamp: 180, SourceID: 180, @@ -654,7 +654,7 @@ func TestMasterService(t *testing.T) { req := &milvuspb.DescribeSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeSegment, + MsgType: commonpb.MsgType_DescribeSegment, MsgID: 190, Timestamp: 190, SourceID: 190, @@ -671,7 +671,7 @@ func TestMasterService(t *testing.T) { t.Run("describe index", func(t *testing.T) { req := &milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: 200, Timestamp: 200, SourceID: 200, @@ -691,7 +691,7 @@ func TestMasterService(t *testing.T) { t.Run("describe index not exist", func(t *testing.T) { req := &milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: 200, Timestamp: 200, SourceID: 200, @@ -731,7 +731,7 @@ func TestMasterService(t *testing.T) { BaseMsg: baseMsg, SegmentMsg: datapb.SegmentMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentInfo, + MsgType: commonpb.MsgType_SegmentInfo, MsgID: 0, Timestamp: 0, SourceID: 0, @@ -752,7 +752,7 @@ func TestMasterService(t *testing.T) { BaseMsg: baseMsg, SegmentFlushCompletedMsg: internalpb2.SegmentFlushCompletedMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentFlushDone, + MsgType: commonpb.MsgType_SegmentFlushDone, MsgID: 0, Timestamp: 0, SourceID: 0, @@ -767,7 +767,7 @@ func TestMasterService(t *testing.T) { req := &milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: 210, Timestamp: 210, SourceID: 210, @@ -787,7 +787,7 @@ func TestMasterService(t *testing.T) { t.Run("drop index", func(t *testing.T) { req := &milvuspb.DropIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropIndex, + MsgType: commonpb.MsgType_DropIndex, MsgID: 215, Timestamp: 215, SourceID: 215, @@ -818,7 +818,7 @@ func TestMasterService(t *testing.T) { t.Run("drop partition", func(t *testing.T) { req := &milvuspb.DropPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropPartition, + MsgType: commonpb.MsgType_DropPartition, MsgID: 220, Timestamp: 220, SourceID: 220, @@ -852,7 +852,7 @@ func TestMasterService(t *testing.T) { t.Run("drop collection", func(t *testing.T) { req := &milvuspb.DropCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropCollection, + MsgType: commonpb.MsgType_DropCollection, MsgID: 230, Timestamp: 230, SourceID: 230, @@ -884,7 +884,7 @@ func TestMasterService(t *testing.T) { req = &milvuspb.DropCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDropCollection, + MsgType: commonpb.MsgType_DropCollection, MsgID: 231, Timestamp: 231, SourceID: 231, diff --git a/internal/masterservice/meta_table.go b/internal/masterservice/meta_table.go index 5023a80e4..fde46bc38 100644 --- a/internal/masterservice/meta_table.go +++ b/internal/masterservice/meta_table.go @@ -42,6 +42,7 @@ type metaTable struct { indexID2Meta map[typeutil.UniqueID]pb.IndexInfo // collection_id/index_id -> meta segID2CollID map[typeutil.UniqueID]typeutil.UniqueID // segment id -> collection id segID2PartitionID map[typeutil.UniqueID]typeutil.UniqueID // segment id -> partition id + flushedSegID map[typeutil.UniqueID]bool // flushed segment id partitionID2CollID map[typeutil.UniqueID]typeutil.UniqueID // partition id -> collection id tenantLock sync.RWMutex @@ -75,6 +76,7 @@ func (mt *metaTable) reloadFromKV() error { mt.partitionID2CollID = make(map[typeutil.UniqueID]typeutil.UniqueID) mt.segID2CollID = make(map[typeutil.UniqueID]typeutil.UniqueID) mt.segID2PartitionID = make(map[typeutil.UniqueID]typeutil.UniqueID) + mt.flushedSegID = make(map[typeutil.UniqueID]bool) _, values, err := mt.client.LoadWithPrefix(TenantMetaPrefix) if err != nil { @@ -141,6 +143,7 @@ func (mt *metaTable) reloadFromKV() error { for _, segID := range partitionInfo.SegmentIDs { mt.segID2CollID[segID] = collID mt.segID2PartitionID[segID] = partitionInfo.PartitionID + mt.flushedSegID[segID] = true } } @@ -246,6 +249,9 @@ func (mt *metaTable) DeleteCollection(collID typeutil.UniqueID) error { } delete(mt.partitionID2Meta, partID) for _, segID := range partMeta.SegmentIDs { + delete(mt.segID2CollID, segID) + delete(mt.segID2PartitionID, segID) + delete(mt.flushedSegID, segID) _, ok := mt.segID2IndexMeta[segID] if !ok { log.Warn("segment id not exist", zap.Int64("segment id", segID)) @@ -447,6 +453,10 @@ func (mt *metaTable) DeletePartition(collID typeutil.UniqueID, partitionName str mt.collID2Meta[collID] = collMeta for _, segID := range partMeta.SegmentIDs { + delete(mt.segID2CollID, segID) + delete(mt.segID2PartitionID, segID) + delete(mt.flushedSegID, segID) + _, ok := mt.segID2IndexMeta[segID] if !ok { log.Warn("segment has no index meta", zap.Int64("segment id", segID)) @@ -574,6 +584,11 @@ func (mt *metaTable) AddIndex(seg *pb.SegmentIndexInfo) error { _ = mt.reloadFromKV() return err } + + if _, ok := mt.flushedSegID[seg.SegmentID]; !ok { + mt.flushedSegID[seg.SegmentID] = true + } + return nil } @@ -658,9 +673,20 @@ func (mt *metaTable) GetSegmentIndexInfoByID(segID typeutil.UniqueID, filedID in mt.ddLock.RLock() defer mt.ddLock.RUnlock() + _, ok := mt.flushedSegID[segID] + if !ok { + return pb.SegmentIndexInfo{}, fmt.Errorf("segment id %d hasn't flused, there is no index meta", segID) + } + segIdxMap, ok := mt.segID2IndexMeta[segID] if !ok { - return pb.SegmentIndexInfo{}, fmt.Errorf("segment id %d not has any index", segID) + return pb.SegmentIndexInfo{ + SegmentID: segID, + FieldID: filedID, + IndexID: 0, + BuildID: 0, + EnableIndex: false, + }, nil } if len(*segIdxMap) == 0 { return pb.SegmentIndexInfo{}, fmt.Errorf("segment id %d not has any index", segID) @@ -872,3 +898,15 @@ func (mt *metaTable) GetIndexByID(indexID typeutil.UniqueID) (*pb.IndexInfo, err } return &indexInfo, nil } + +func (mt *metaTable) AddFlushedSegment(segID typeutil.UniqueID) error { + mt.ddLock.Lock() + defer mt.ddLock.Unlock() + + _, ok := mt.flushedSegID[segID] + if ok { + return fmt.Errorf("segment id = %d exist", segID) + } + mt.flushedSegID[segID] = true + return nil +} diff --git a/internal/masterservice/task.go b/internal/masterservice/task.go index 6910a74d5..0aa426852 100644 --- a/internal/masterservice/task.go +++ b/internal/masterservice/task.go @@ -166,7 +166,7 @@ func (t *CreateCollectionReqTask) Execute() error { ddPart := internalpb2.CreatePartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kCreatePartition, + MsgType: commonpb.MsgType_CreatePartition, MsgID: t.Req.Base.MsgID, //TODO, msg id Timestamp: t.Req.Base.Timestamp + 1, SourceID: t.Req.Base.SourceID, diff --git a/internal/msgstream/pulsarms/msg_test.go b/internal/msgstream/pulsarms/msg_test.go index 088d76edc..8e6d9c50b 100644 --- a/internal/msgstream/pulsarms/msg_test.go +++ b/internal/msgstream/pulsarms/msg_test.go @@ -51,7 +51,7 @@ func (tt *InsertTask) Unmarshal(input MarshalType) (msgstream.TsMsg, error) { func newRepackFunc(tsMsgs []msgstream.TsMsg, hashKeys [][]int32) (map[int32]*msgstream.MsgPack, error) { result := make(map[int32]*msgstream.MsgPack) for i, request := range tsMsgs { - if request.Type() != commonpb.MsgType_kInsert { + if request.Type() != commonpb.MsgType_Insert { return nil, errors.New("msg's must be Insert") } insertRequest := request.(*InsertTask).InsertRequest @@ -74,7 +74,7 @@ func newRepackFunc(tsMsgs []msgstream.TsMsg, hashKeys [][]int32) (map[int32]*msg sliceRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: insertRequest.Base.MsgID, Timestamp: insertRequest.Timestamps[index], SourceID: insertRequest.Base.SourceID, @@ -106,7 +106,7 @@ func getInsertTask(reqID msgstream.UniqueID, hashValue uint32) msgstream.TsMsg { } insertRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: reqID, Timestamp: 1, SourceID: 1, @@ -151,7 +151,7 @@ func TestStream_task_Insert(t *testing.T) { dispatcher := factory.NewUnmarshalDispatcher() outputStream, _ := newPulsarMsgStream(context.Background(), pulsarAddress, 100, 100, dispatcher) testTask := InsertTask{} - dispatcher.AddMsgTemplate(commonpb.MsgType_kInsert, testTask.Unmarshal) + dispatcher.AddMsgTemplate(commonpb.MsgType_Insert, testTask.Unmarshal) outputStream.AsConsumer(consumerChannels, consumerSubName) outputStream.Start() diff --git a/internal/msgstream/pulsarms/pulsar_msgstream.go b/internal/msgstream/pulsarms/pulsar_msgstream.go index 778c34801..8998acb74 100644 --- a/internal/msgstream/pulsarms/pulsar_msgstream.go +++ b/internal/msgstream/pulsarms/pulsar_msgstream.go @@ -199,7 +199,7 @@ func (ms *PulsarMsgStream) Produce(ctx context.Context, msgPack *MsgPack) error hashValues := tsMsg.HashKeys() bucketValues := make([]int32, len(hashValues)) for index, hashValue := range hashValues { - if tsMsg.Type() == commonpb.MsgType_kSearchResult { + if tsMsg.Type() == commonpb.MsgType_SearchResult { searchResult := tsMsg.(*msgstream.SearchResultMsg) channelID := searchResult.ResultChannelID channelIDInt, _ := strconv.ParseInt(channelID, 10, 64) @@ -221,9 +221,9 @@ func (ms *PulsarMsgStream) Produce(ctx context.Context, msgPack *MsgPack) error } else { msgType := (tsMsgs[0]).Type() switch msgType { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: result, err = util.InsertRepackFunc(tsMsgs, reBucketValues) - case commonpb.MsgType_kDelete: + case commonpb.MsgType_Delete: result, err = util.DeleteRepackFunc(tsMsgs, reBucketValues) default: result, err = util.DefaultRepackFunc(tsMsgs, reBucketValues) @@ -621,7 +621,7 @@ func (ms *PulsarTtMsgStream) bufMsgPackToChannel() { tempBuffer := make([]TsMsg, 0) var timeTickMsg TsMsg for _, v := range msgs { - if v.Type() == commonpb.MsgType_kTimeTick { + if v.Type() == commonpb.MsgType_TimeTick { timeTickMsg = v continue } @@ -705,7 +705,7 @@ func (ms *PulsarTtMsgStream) findTimeTick(consumer Consumer, ms.unsolvedBuf[consumer] = append(ms.unsolvedBuf[consumer], tsMsg) ms.unsolvedMutex.Unlock() - if headerMsg.Base.MsgType == commonpb.MsgType_kTimeTick { + if headerMsg.Base.MsgType == commonpb.MsgType_TimeTick { findMapMutex.Lock() eofMsgMap[consumer] = tsMsg.(*TimeTickMsg).Base.Timestamp findMapMutex.Unlock() @@ -767,7 +767,7 @@ func (ms *PulsarTtMsgStream) Seek(mp *internalpb2.MsgPosition) error { if err != nil { log.Error("Failed to unmarshal tsMsg", zap.Error(err)) } - if tsMsg.Type() == commonpb.MsgType_kTimeTick { + if tsMsg.Type() == commonpb.MsgType_TimeTick { if tsMsg.BeginTs() >= mp.Timestamp { ms.unsolvedMutex.Unlock() return nil diff --git a/internal/msgstream/pulsarms/pulsar_msgstream_test.go b/internal/msgstream/pulsarms/pulsar_msgstream_test.go index 62dc6d2dd..b9f7237a6 100644 --- a/internal/msgstream/pulsarms/pulsar_msgstream_test.go +++ b/internal/msgstream/pulsarms/pulsar_msgstream_test.go @@ -48,10 +48,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { HashValues: []uint32{hashValue}, } switch msgType { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: insertRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -69,10 +69,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { InsertRequest: insertRequest, } return insertMsg - case commonpb.MsgType_kDelete: + case commonpb.MsgType_Delete: deleteRequest := internalpb2.DeleteRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDelete, + MsgType: commonpb.MsgType_Delete, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -87,10 +87,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { DeleteRequest: deleteRequest, } return deleteMsg - case commonpb.MsgType_kSearch: + case commonpb.MsgType_Search: searchRequest := internalpb2.SearchRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearch, + MsgType: commonpb.MsgType_Search, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -103,10 +103,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { SearchRequest: searchRequest, } return searchMsg - case commonpb.MsgType_kSearchResult: + case commonpb.MsgType_SearchResult: searchResult := internalpb2.SearchResults{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearchResult, + MsgType: commonpb.MsgType_SearchResult, MsgID: reqID, Timestamp: 1, SourceID: reqID, @@ -119,10 +119,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { SearchResults: searchResult, } return searchResultMsg - case commonpb.MsgType_kTimeTick: + case commonpb.MsgType_TimeTick: timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, Timestamp: 1, SourceID: reqID, @@ -133,10 +133,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { TimeTickMsg: timeTickResult, } return timeTickMsg - case commonpb.MsgType_kQueryNodeStats: + case commonpb.MsgType_QueryNodeStats: queryNodeSegStats := internalpb2.QueryNodeStats{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kQueryNodeStats, + MsgType: commonpb.MsgType_QueryNodeStats, SourceID: reqID, }, } @@ -157,7 +157,7 @@ func getTimeTickMsg(reqID UniqueID, hashValue uint32, time uint64) TsMsg { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, Timestamp: time, SourceID: reqID, @@ -246,8 +246,8 @@ func TestStream_PulsarMsgStream_Insert(t *testing.T) { consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Produce(ctx, &msgPack) @@ -269,8 +269,8 @@ func TestStream_PulsarMsgStream_Delete(t *testing.T) { consumerChannels := []string{c} consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kDelete, 1, 1)) - //msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kDelete, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Delete, 1, 1)) + //msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Delete, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Produce(ctx, &msgPack) @@ -291,8 +291,8 @@ func TestStream_PulsarMsgStream_Search(t *testing.T) { consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearch, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearch, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Search, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Search, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Produce(ctx, &msgPack) @@ -312,8 +312,8 @@ func TestStream_PulsarMsgStream_SearchResult(t *testing.T) { consumerChannels := []string{c} consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearchResult, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearchResult, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_SearchResult, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_SearchResult, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Produce(ctx, &msgPack) @@ -333,8 +333,8 @@ func TestStream_PulsarMsgStream_TimeTick(t *testing.T) { consumerChannels := []string{c} consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Produce(ctx, &msgPack) @@ -355,8 +355,8 @@ func TestStream_PulsarMsgStream_BroadCast(t *testing.T) { consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName) err := inputStream.Broadcast(ctx, &msgPack) @@ -377,8 +377,8 @@ func TestStream_PulsarMsgStream_RepackFunc(t *testing.T) { consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) inputStream, outputStream := initPulsarStream(pulsarAddress, producerChannels, consumerChannels, consumerSubName, repackFunc) err := inputStream.Produce(ctx, &msgPack) @@ -405,7 +405,7 @@ func TestStream_PulsarMsgStream_InsertRepackFunc(t *testing.T) { insertRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 1, Timestamp: 1, SourceID: 1, @@ -461,7 +461,7 @@ func TestStream_PulsarMsgStream_DeleteRepackFunc(t *testing.T) { deleteRequest := internalpb2.DeleteRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDelete, + MsgType: commonpb.MsgType_Delete, MsgID: 1, Timestamp: 1, SourceID: 1, @@ -507,10 +507,10 @@ func TestStream_PulsarMsgStream_DefaultRepackFunc(t *testing.T) { consumerSubName := funcutil.RandomString(8) msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearch, 2, 2)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearchResult, 3, 3)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kQueryNodeStats, 4, 4)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Search, 2, 2)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_SearchResult, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_QueryNodeStats, 4, 4)) factory := msgstream.ProtoUDFactory{} inputStream, _ := newPulsarMsgStream(context.Background(), pulsarAddress, 100, 100, factory.NewUnmarshalDispatcher()) @@ -542,8 +542,8 @@ func TestStream_PulsarTtMsgStream_Insert(t *testing.T) { msgPack0.Msgs = append(msgPack0.Msgs, getTimeTickMsg(0, 0, 0)) msgPack1 := msgstream.MsgPack{} - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) msgPack2 := msgstream.MsgPack{} msgPack2.Msgs = append(msgPack2.Msgs, getTimeTickMsg(5, 5, 5)) @@ -578,15 +578,15 @@ func TestStream_PulsarTtMsgStream_Seek(t *testing.T) { msgPack0.Msgs = append(msgPack0.Msgs, getTimeTickMsg(0, 0, 0)) msgPack1 := MsgPack{} - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 19, 19)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 19, 19)) msgPack2 := MsgPack{} msgPack2.Msgs = append(msgPack2.Msgs, getTimeTickMsg(5, 5, 5)) msgPack3 := MsgPack{} - msgPack3.Msgs = append(msgPack3.Msgs, getTsMsg(commonpb.MsgType_kInsert, 14, 14)) - msgPack3.Msgs = append(msgPack3.Msgs, getTsMsg(commonpb.MsgType_kInsert, 9, 9)) + msgPack3.Msgs = append(msgPack3.Msgs, getTsMsg(commonpb.MsgType_Insert, 14, 14)) + msgPack3.Msgs = append(msgPack3.Msgs, getTsMsg(commonpb.MsgType_Insert, 9, 9)) msgPack4 := MsgPack{} msgPack4.Msgs = append(msgPack4.Msgs, getTimeTickMsg(11, 11, 11)) @@ -633,8 +633,8 @@ func TestStream_PulsarTtMsgStream_UnMarshalHeader(t *testing.T) { msgPack0.Msgs = append(msgPack0.Msgs, getTimeTickMsg(0, 0, 0)) msgPack1 := msgstream.MsgPack{} - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) msgPack2 := msgstream.MsgPack{} msgPack2.Msgs = append(msgPack2.Msgs, getTimeTickMsg(5, 5, 5)) diff --git a/internal/msgstream/rmqms/rmq_msgstream.go b/internal/msgstream/rmqms/rmq_msgstream.go index 75455b68c..d8b3cc5f7 100644 --- a/internal/msgstream/rmqms/rmq_msgstream.go +++ b/internal/msgstream/rmqms/rmq_msgstream.go @@ -140,7 +140,7 @@ func (ms *RmqMsgStream) Produce(ctx context.Context, pack *msgstream.MsgPack) er hashValues := tsMsg.HashKeys() bucketValues := make([]int32, len(hashValues)) for index, hashValue := range hashValues { - if tsMsg.Type() == commonpb.MsgType_kSearchResult { + if tsMsg.Type() == commonpb.MsgType_SearchResult { searchResult := tsMsg.(*msgstream.SearchResultMsg) channelID := searchResult.ResultChannelID channelIDInt, _ := strconv.ParseInt(channelID, 10, 64) @@ -162,9 +162,9 @@ func (ms *RmqMsgStream) Produce(ctx context.Context, pack *msgstream.MsgPack) er } else { msgType := (tsMsgs[0]).Type() switch msgType { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: result, err = util.InsertRepackFunc(tsMsgs, reBucketValues) - case commonpb.MsgType_kDelete: + case commonpb.MsgType_Delete: result, err = util.DeleteRepackFunc(tsMsgs, reBucketValues) default: result, err = util.DefaultRepackFunc(tsMsgs, reBucketValues) @@ -389,7 +389,7 @@ func (ms *RmqTtMsgStream) bufMsgPackToChannel() { tempBuffer := make([]TsMsg, 0) var timeTickMsg TsMsg for _, v := range msgs { - if v.Type() == commonpb.MsgType_kTimeTick { + if v.Type() == commonpb.MsgType_TimeTick { timeTickMsg = v continue } @@ -475,7 +475,7 @@ func (ms *RmqTtMsgStream) findTimeTick(consumer rocksmq.Consumer, ms.unsolvedBuf[consumer] = append(ms.unsolvedBuf[consumer], tsMsg) ms.unsolvedMutex.Unlock() - if headerMsg.Base.MsgType == commonpb.MsgType_kTimeTick { + if headerMsg.Base.MsgType == commonpb.MsgType_TimeTick { findMapMutex.Lock() eofMsgMap[consumer] = tsMsg.(*TimeTickMsg).Base.Timestamp findMapMutex.Unlock() @@ -537,7 +537,7 @@ func (ms *RmqTtMsgStream) Seek(mp *msgstream.MsgPosition) error { return err } - if headerMsg.Base.MsgType == commonpb.MsgType_kTimeTick { + if headerMsg.Base.MsgType == commonpb.MsgType_TimeTick { if tsMsg.BeginTs() >= mp.Timestamp { ms.unsolvedMutex.Unlock() return nil diff --git a/internal/msgstream/rmqms/rmq_msgstream_test.go b/internal/msgstream/rmqms/rmq_msgstream_test.go index ef5cb17d5..36b9bc8bf 100644 --- a/internal/msgstream/rmqms/rmq_msgstream_test.go +++ b/internal/msgstream/rmqms/rmq_msgstream_test.go @@ -41,10 +41,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { HashValues: []uint32{hashValue}, } switch msgType { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: insertRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -62,10 +62,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { InsertRequest: insertRequest, } return insertMsg - case commonpb.MsgType_kDelete: + case commonpb.MsgType_Delete: deleteRequest := internalpb2.DeleteRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDelete, + MsgType: commonpb.MsgType_Delete, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -80,10 +80,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { DeleteRequest: deleteRequest, } return deleteMsg - case commonpb.MsgType_kSearch: + case commonpb.MsgType_Search: searchRequest := internalpb2.SearchRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearch, + MsgType: commonpb.MsgType_Search, MsgID: reqID, Timestamp: 11, SourceID: reqID, @@ -96,10 +96,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { SearchRequest: searchRequest, } return searchMsg - case commonpb.MsgType_kSearchResult: + case commonpb.MsgType_SearchResult: searchResult := internalpb2.SearchResults{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearchResult, + MsgType: commonpb.MsgType_SearchResult, MsgID: reqID, Timestamp: 1, SourceID: reqID, @@ -112,10 +112,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { SearchResults: searchResult, } return searchResultMsg - case commonpb.MsgType_kTimeTick: + case commonpb.MsgType_TimeTick: timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, Timestamp: 1, SourceID: reqID, @@ -126,10 +126,10 @@ func getTsMsg(msgType MsgType, reqID UniqueID, hashValue uint32) TsMsg { TimeTickMsg: timeTickResult, } return timeTickMsg - case commonpb.MsgType_kQueryNodeStats: + case commonpb.MsgType_QueryNodeStats: queryNodeSegStats := internalpb2.QueryNodeStats{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kQueryNodeStats, + MsgType: commonpb.MsgType_QueryNodeStats, SourceID: reqID, }, } @@ -150,7 +150,7 @@ func getTimeTickMsg(reqID UniqueID, hashValue uint32, time uint64) TsMsg { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, Timestamp: time, SourceID: reqID, @@ -260,8 +260,8 @@ func TestStream_RmqMsgStream_Insert(t *testing.T) { consumerGroupName := "InsertGroup" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) rocksdbName := "/tmp/rocksmq_insert" etcdKV := initRmq(rocksdbName) @@ -282,7 +282,7 @@ func TestStream_RmqMsgStream_Delete(t *testing.T) { consumerSubName := "subDelete" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kDelete, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Delete, 1, 1)) rocksdbName := "/tmp/rocksmq_delete" etcdKV := initRmq(rocksdbName) @@ -302,8 +302,8 @@ func TestStream_RmqMsgStream_Search(t *testing.T) { consumerSubName := "subSearch" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearch, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearch, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Search, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Search, 3, 3)) rocksdbName := "/tmp/rocksmq_search" etcdKV := initRmq(rocksdbName) @@ -324,8 +324,8 @@ func TestStream_RmqMsgStream_SearchResult(t *testing.T) { consumerSubName := "subSearchResult" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearchResult, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kSearchResult, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_SearchResult, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_SearchResult, 3, 3)) rocksdbName := "/tmp/rocksmq_searchresult" etcdKV := initRmq(rocksdbName) @@ -345,8 +345,8 @@ func TestStream_RmqMsgStream_TimeTick(t *testing.T) { consumerSubName := "subTimeTick" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 3, 3)) rocksdbName := "/tmp/rocksmq_timetick" etcdKV := initRmq(rocksdbName) @@ -366,8 +366,8 @@ func TestStream_RmqMsgStream_BroadCast(t *testing.T) { consumerSubName := "subInsert" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kTimeTick, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_TimeTick, 3, 3)) rocksdbName := "/tmp/rocksmq_broadcast" etcdKV := initRmq(rocksdbName) @@ -388,8 +388,8 @@ func TestStream_RmqMsgStream_RepackFunc(t *testing.T) { consumerSubName := "subInsert" msgPack := msgstream.MsgPack{} - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack.Msgs = append(msgPack.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) rocksdbName := "/tmp/rocksmq_repackfunc" etcdKV := initRmq(rocksdbName) @@ -413,8 +413,8 @@ func TestStream_PulsarTtMsgStream_Insert(t *testing.T) { msgPack0.Msgs = append(msgPack0.Msgs, getTimeTickMsg(0, 0, 0)) msgPack1 := msgstream.MsgPack{} - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 1, 1)) - msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_kInsert, 3, 3)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 1, 1)) + msgPack1.Msgs = append(msgPack1.Msgs, getTsMsg(commonpb.MsgType_Insert, 3, 3)) msgPack2 := msgstream.MsgPack{} msgPack2.Msgs = append(msgPack2.Msgs, getTimeTickMsg(5, 5, 5)) diff --git a/internal/msgstream/unmarshal.go b/internal/msgstream/unmarshal.go index ea38e05e3..014832a24 100644 --- a/internal/msgstream/unmarshal.go +++ b/internal/msgstream/unmarshal.go @@ -56,21 +56,21 @@ func (pudf *ProtoUDFactory) NewUnmarshalDispatcher() *ProtoUnmarshalDispatcher { p := &ProtoUnmarshalDispatcher{} p.TempMap = make(map[commonpb.MsgType]UnmarshalFunc) - p.TempMap[commonpb.MsgType_kInsert] = insertMsg.Unmarshal - p.TempMap[commonpb.MsgType_kDelete] = deleteMsg.Unmarshal - p.TempMap[commonpb.MsgType_kSearch] = searchMsg.Unmarshal - p.TempMap[commonpb.MsgType_kSearchResult] = searchResultMsg.Unmarshal - p.TempMap[commonpb.MsgType_kTimeTick] = timeTickMsg.Unmarshal - p.TempMap[commonpb.MsgType_kQueryNodeStats] = queryNodeSegStatsMsg.Unmarshal - p.TempMap[commonpb.MsgType_kCreateCollection] = createCollectionMsg.Unmarshal - p.TempMap[commonpb.MsgType_kDropCollection] = dropCollectionMsg.Unmarshal - p.TempMap[commonpb.MsgType_kCreatePartition] = createPartitionMsg.Unmarshal - p.TempMap[commonpb.MsgType_kDropPartition] = dropPartitionMsg.Unmarshal - p.TempMap[commonpb.MsgType_kLoadIndex] = loadIndexMsg.Unmarshal - p.TempMap[commonpb.MsgType_kFlush] = flushMsg.Unmarshal - p.TempMap[commonpb.MsgType_kSegmentInfo] = segmentInfoMsg.Unmarshal - p.TempMap[commonpb.MsgType_kSegmentFlushDone] = flushCompletedMsg.Unmarshal - p.TempMap[commonpb.MsgType_kSegmentStatistics] = segmentStatisticsMsg.Unmarshal + p.TempMap[commonpb.MsgType_Insert] = insertMsg.Unmarshal + p.TempMap[commonpb.MsgType_Delete] = deleteMsg.Unmarshal + p.TempMap[commonpb.MsgType_Search] = searchMsg.Unmarshal + p.TempMap[commonpb.MsgType_SearchResult] = searchResultMsg.Unmarshal + p.TempMap[commonpb.MsgType_TimeTick] = timeTickMsg.Unmarshal + p.TempMap[commonpb.MsgType_QueryNodeStats] = queryNodeSegStatsMsg.Unmarshal + p.TempMap[commonpb.MsgType_CreateCollection] = createCollectionMsg.Unmarshal + p.TempMap[commonpb.MsgType_DropCollection] = dropCollectionMsg.Unmarshal + p.TempMap[commonpb.MsgType_CreatePartition] = createPartitionMsg.Unmarshal + p.TempMap[commonpb.MsgType_DropPartition] = dropPartitionMsg.Unmarshal + p.TempMap[commonpb.MsgType_LoadIndex] = loadIndexMsg.Unmarshal + p.TempMap[commonpb.MsgType_Flush] = flushMsg.Unmarshal + p.TempMap[commonpb.MsgType_SegmentInfo] = segmentInfoMsg.Unmarshal + p.TempMap[commonpb.MsgType_SegmentFlushDone] = flushCompletedMsg.Unmarshal + p.TempMap[commonpb.MsgType_SegmentStatistics] = segmentStatisticsMsg.Unmarshal return p } diff --git a/internal/msgstream/unmarshal_test.go b/internal/msgstream/unmarshal_test.go index b6d2742e8..67f74e6ef 100644 --- a/internal/msgstream/unmarshal_test.go +++ b/internal/msgstream/unmarshal_test.go @@ -35,7 +35,7 @@ func TestStream_unmarshal_Insert(t *testing.T) { }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 1, Timestamp: 11, SourceID: 1, diff --git a/internal/msgstream/util/repack_func.go b/internal/msgstream/util/repack_func.go index a4d9692ce..a1de5c73f 100644 --- a/internal/msgstream/util/repack_func.go +++ b/internal/msgstream/util/repack_func.go @@ -16,7 +16,7 @@ type BaseMsg = msgstream.BaseMsg func InsertRepackFunc(tsMsgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, error) { result := make(map[int32]*MsgPack) for i, request := range tsMsgs { - if request.Type() != commonpb.MsgType_kInsert { + if request.Type() != commonpb.MsgType_Insert { return nil, errors.New("msg's must be Insert") } insertRequest := request.(*msgstream.InsertMsg) @@ -39,7 +39,7 @@ func InsertRepackFunc(tsMsgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, e sliceRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: insertRequest.Base.MsgID, Timestamp: insertRequest.Timestamps[index], SourceID: insertRequest.Base.SourceID, @@ -68,7 +68,7 @@ func InsertRepackFunc(tsMsgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, e func DeleteRepackFunc(tsMsgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, error) { result := make(map[int32]*MsgPack) for i, request := range tsMsgs { - if request.Type() != commonpb.MsgType_kDelete { + if request.Type() != commonpb.MsgType_Delete { return nil, errors.New("msg's must be Delete") } deleteRequest := request.(*msgstream.DeleteMsg) @@ -91,7 +91,7 @@ func DeleteRepackFunc(tsMsgs []TsMsg, hashKeys [][]int32) (map[int32]*MsgPack, e sliceRequest := internalpb2.DeleteRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDelete, + MsgType: commonpb.MsgType_Delete, MsgID: deleteRequest.Base.MsgID, Timestamp: deleteRequest.Timestamps[index], SourceID: deleteRequest.Base.SourceID, diff --git a/internal/proto/common.proto b/internal/proto/common.proto index 353d3b744..aa4a90b65 100644 --- a/internal/proto/common.proto +++ b/internal/proto/common.proto @@ -77,59 +77,59 @@ message Address { } enum MsgType { - kNone = 0; - /* Definition Requests: collection */ - kCreateCollection = 100; - kDropCollection = 101; - kHasCollection = 102; - kDescribeCollection = 103; - kShowCollections = 104; - kGetSysConfigs = 105; - kLoadCollection = 106; - kReleaseCollection = 107; - - /* Definition Requests: partition */ - kCreatePartition = 200; - kDropPartition = 201; - kHasPartition = 202; - kDescribePartition = 203; - kShowPartitions = 204; - kLoadPartition = 205; - kReleasePartition = 206; - - /* Define Requests: segment */ - kShowSegment = 250; - kDescribeSegment = 251; - - /* Definition Requests: Index */ - kCreateIndex = 300; - kDescribeIndex = 301; - kDropIndex = 302; - - /* Manipulation Requests */ - kInsert = 400; - kDelete = 401; - kFlush = 402; - - /* Query */ - kSearch = 500; - kSearchResult = 501; - kGetIndexState = 502; - kGetCollectionStatistics = 503; - kGetPartitionStatistics = 504; - - /* Data Service */ - kSegmentInfo = 600; - - /* System Control */ - kTimeTick = 1200; - kQueryNodeStats = 1201; // GOOSE TODO: Remove kQueryNodeStats - kLoadIndex = 1202; - kRequestID = 1203; - kRequestTSO = 1204; - kAllocateSegment = 1205; - kSegmentStatistics = 1206; - kSegmentFlushDone = 1207; + None = 0; + /* DEFINITION REQUESTS: COLLECTION */ + CreateCollection = 100; + DropCollection = 101; + HasCollection = 102; + DescribeCollection = 103; + ShowCollections = 104; + GetSystemConfigs = 105; + LoadCollection = 106; + ReleaseCollection = 107; + + /* DEFINITION REQUESTS: PARTITION */ + CreatePartition = 200; + DropPartition = 201; + HasPartition = 202; + DescribePartition = 203; + ShowPartitions = 204; + LoadPartitions = 205; + ReleasePartitions = 206; + + /* DEFINE REQUESTS: SEGMENT */ + ShowSegments = 250; + DescribeSegment = 251; + + /* DEFINITION REQUESTS: INDEX */ + CreateIndex = 300; + DescribeIndex = 301; + DropIndex = 302; + + /* MANIPULATION REQUESTS */ + Insert = 400; + Delete = 401; + Flush = 402; + + /* QUERY */ + Search = 500; + SearchResult = 501; + GetIndexState = 502; + GetCollectionStatistics = 503; + GetPartitionStatistics = 504; + + /* DATA SERVICE */ + SegmentInfo = 600; + + /* SYSTEM CONTROL */ + TimeTick = 1200; + QueryNodeStats = 1201; // GOOSE TODO: Remove kQueryNodeStats + LoadIndex = 1202; + RequestID = 1203; + RequestTSO = 1204; + AllocateSegment = 1205; + SegmentStatistics = 1206; + SegmentFlushDone = 1207; } message MsgBase { diff --git a/internal/proto/commonpb/common.pb.go b/internal/proto/commonpb/common.pb.go index 378920638..783d0fb85 100644 --- a/internal/proto/commonpb/common.pb.go +++ b/internal/proto/commonpb/common.pb.go @@ -192,134 +192,134 @@ func (SegmentState) EnumDescriptor() ([]byte, []int) { type MsgType int32 const ( - MsgType_kNone MsgType = 0 - // Definition Requests: collection - MsgType_kCreateCollection MsgType = 100 - MsgType_kDropCollection MsgType = 101 - MsgType_kHasCollection MsgType = 102 - MsgType_kDescribeCollection MsgType = 103 - MsgType_kShowCollections MsgType = 104 - MsgType_kGetSysConfigs MsgType = 105 - MsgType_kLoadCollection MsgType = 106 - MsgType_kReleaseCollection MsgType = 107 - // Definition Requests: partition - MsgType_kCreatePartition MsgType = 200 - MsgType_kDropPartition MsgType = 201 - MsgType_kHasPartition MsgType = 202 - MsgType_kDescribePartition MsgType = 203 - MsgType_kShowPartitions MsgType = 204 - MsgType_kLoadPartition MsgType = 205 - MsgType_kReleasePartition MsgType = 206 - // Define Requests: segment - MsgType_kShowSegment MsgType = 250 - MsgType_kDescribeSegment MsgType = 251 - // Definition Requests: Index - MsgType_kCreateIndex MsgType = 300 - MsgType_kDescribeIndex MsgType = 301 - MsgType_kDropIndex MsgType = 302 - // Manipulation Requests - MsgType_kInsert MsgType = 400 - MsgType_kDelete MsgType = 401 - MsgType_kFlush MsgType = 402 - // Query - MsgType_kSearch MsgType = 500 - MsgType_kSearchResult MsgType = 501 - MsgType_kGetIndexState MsgType = 502 - MsgType_kGetCollectionStatistics MsgType = 503 - MsgType_kGetPartitionStatistics MsgType = 504 - // Data Service - MsgType_kSegmentInfo MsgType = 600 - // System Control - MsgType_kTimeTick MsgType = 1200 - MsgType_kQueryNodeStats MsgType = 1201 - MsgType_kLoadIndex MsgType = 1202 - MsgType_kRequestID MsgType = 1203 - MsgType_kRequestTSO MsgType = 1204 - MsgType_kAllocateSegment MsgType = 1205 - MsgType_kSegmentStatistics MsgType = 1206 - MsgType_kSegmentFlushDone MsgType = 1207 + MsgType_None MsgType = 0 + // DEFINITION REQUESTS: COLLECTION + MsgType_CreateCollection MsgType = 100 + MsgType_DropCollection MsgType = 101 + MsgType_HasCollection MsgType = 102 + MsgType_DescribeCollection MsgType = 103 + MsgType_ShowCollections MsgType = 104 + MsgType_GetSystemConfigs MsgType = 105 + MsgType_LoadCollection MsgType = 106 + MsgType_ReleaseCollection MsgType = 107 + // DEFINITION REQUESTS: PARTITION + MsgType_CreatePartition MsgType = 200 + MsgType_DropPartition MsgType = 201 + MsgType_HasPartition MsgType = 202 + MsgType_DescribePartition MsgType = 203 + MsgType_ShowPartitions MsgType = 204 + MsgType_LoadPartitions MsgType = 205 + MsgType_ReleasePartitions MsgType = 206 + // DEFINE REQUESTS: SEGMENT + MsgType_ShowSegments MsgType = 250 + MsgType_DescribeSegment MsgType = 251 + // DEFINITION REQUESTS: INDEX + MsgType_CreateIndex MsgType = 300 + MsgType_DescribeIndex MsgType = 301 + MsgType_DropIndex MsgType = 302 + // MANIPULATION REQUESTS + MsgType_Insert MsgType = 400 + MsgType_Delete MsgType = 401 + MsgType_Flush MsgType = 402 + // QUERY + MsgType_Search MsgType = 500 + MsgType_SearchResult MsgType = 501 + MsgType_GetIndexState MsgType = 502 + MsgType_GetCollectionStatistics MsgType = 503 + MsgType_GetPartitionStatistics MsgType = 504 + // DATA SERVICE + MsgType_SegmentInfo MsgType = 600 + // SYSTEM CONTROL + MsgType_TimeTick MsgType = 1200 + MsgType_QueryNodeStats MsgType = 1201 + MsgType_LoadIndex MsgType = 1202 + MsgType_RequestID MsgType = 1203 + MsgType_RequestTSO MsgType = 1204 + MsgType_AllocateSegment MsgType = 1205 + MsgType_SegmentStatistics MsgType = 1206 + MsgType_SegmentFlushDone MsgType = 1207 ) var MsgType_name = map[int32]string{ - 0: "kNone", - 100: "kCreateCollection", - 101: "kDropCollection", - 102: "kHasCollection", - 103: "kDescribeCollection", - 104: "kShowCollections", - 105: "kGetSysConfigs", - 106: "kLoadCollection", - 107: "kReleaseCollection", - 200: "kCreatePartition", - 201: "kDropPartition", - 202: "kHasPartition", - 203: "kDescribePartition", - 204: "kShowPartitions", - 205: "kLoadPartition", - 206: "kReleasePartition", - 250: "kShowSegment", - 251: "kDescribeSegment", - 300: "kCreateIndex", - 301: "kDescribeIndex", - 302: "kDropIndex", - 400: "kInsert", - 401: "kDelete", - 402: "kFlush", - 500: "kSearch", - 501: "kSearchResult", - 502: "kGetIndexState", - 503: "kGetCollectionStatistics", - 504: "kGetPartitionStatistics", - 600: "kSegmentInfo", - 1200: "kTimeTick", - 1201: "kQueryNodeStats", - 1202: "kLoadIndex", - 1203: "kRequestID", - 1204: "kRequestTSO", - 1205: "kAllocateSegment", - 1206: "kSegmentStatistics", - 1207: "kSegmentFlushDone", + 0: "None", + 100: "CreateCollection", + 101: "DropCollection", + 102: "HasCollection", + 103: "DescribeCollection", + 104: "ShowCollections", + 105: "GetSystemConfigs", + 106: "LoadCollection", + 107: "ReleaseCollection", + 200: "CreatePartition", + 201: "DropPartition", + 202: "HasPartition", + 203: "DescribePartition", + 204: "ShowPartitions", + 205: "LoadPartitions", + 206: "ReleasePartitions", + 250: "ShowSegments", + 251: "DescribeSegment", + 300: "CreateIndex", + 301: "DescribeIndex", + 302: "DropIndex", + 400: "Insert", + 401: "Delete", + 402: "Flush", + 500: "Search", + 501: "SearchResult", + 502: "GetIndexState", + 503: "GetCollectionStatistics", + 504: "GetPartitionStatistics", + 600: "SegmentInfo", + 1200: "TimeTick", + 1201: "QueryNodeStats", + 1202: "LoadIndex", + 1203: "RequestID", + 1204: "RequestTSO", + 1205: "AllocateSegment", + 1206: "SegmentStatistics", + 1207: "SegmentFlushDone", } var MsgType_value = map[string]int32{ - "kNone": 0, - "kCreateCollection": 100, - "kDropCollection": 101, - "kHasCollection": 102, - "kDescribeCollection": 103, - "kShowCollections": 104, - "kGetSysConfigs": 105, - "kLoadCollection": 106, - "kReleaseCollection": 107, - "kCreatePartition": 200, - "kDropPartition": 201, - "kHasPartition": 202, - "kDescribePartition": 203, - "kShowPartitions": 204, - "kLoadPartition": 205, - "kReleasePartition": 206, - "kShowSegment": 250, - "kDescribeSegment": 251, - "kCreateIndex": 300, - "kDescribeIndex": 301, - "kDropIndex": 302, - "kInsert": 400, - "kDelete": 401, - "kFlush": 402, - "kSearch": 500, - "kSearchResult": 501, - "kGetIndexState": 502, - "kGetCollectionStatistics": 503, - "kGetPartitionStatistics": 504, - "kSegmentInfo": 600, - "kTimeTick": 1200, - "kQueryNodeStats": 1201, - "kLoadIndex": 1202, - "kRequestID": 1203, - "kRequestTSO": 1204, - "kAllocateSegment": 1205, - "kSegmentStatistics": 1206, - "kSegmentFlushDone": 1207, + "None": 0, + "CreateCollection": 100, + "DropCollection": 101, + "HasCollection": 102, + "DescribeCollection": 103, + "ShowCollections": 104, + "GetSystemConfigs": 105, + "LoadCollection": 106, + "ReleaseCollection": 107, + "CreatePartition": 200, + "DropPartition": 201, + "HasPartition": 202, + "DescribePartition": 203, + "ShowPartitions": 204, + "LoadPartitions": 205, + "ReleasePartitions": 206, + "ShowSegments": 250, + "DescribeSegment": 251, + "CreateIndex": 300, + "DescribeIndex": 301, + "DropIndex": 302, + "Insert": 400, + "Delete": 401, + "Flush": 402, + "Search": 500, + "SearchResult": 501, + "GetIndexState": 502, + "GetCollectionStatistics": 503, + "GetPartitionStatistics": 504, + "SegmentInfo": 600, + "TimeTick": 1200, + "QueryNodeStats": 1201, + "LoadIndex": 1202, + "RequestID": 1203, + "RequestTSO": 1204, + "AllocateSegment": 1205, + "SegmentStatistics": 1206, + "SegmentFlushDone": 1207, } func (x MsgType) String() string { @@ -580,7 +580,7 @@ func (m *MsgBase) GetMsgType() MsgType { if m != nil { return m.MsgType } - return MsgType_kNone + return MsgType_None } func (m *MsgBase) GetMsgID() int64 { @@ -661,86 +661,85 @@ func init() { func init() { proto.RegisterFile("common.proto", fileDescriptor_555bd8c177793206) } var fileDescriptor_555bd8c177793206 = []byte{ - // 1285 bytes of a gzipped FileDescriptorProto + // 1278 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x55, 0xcb, 0x6e, 0xdb, 0x46, - 0x1b, 0x0d, 0x25, 0xd9, 0x0a, 0x3f, 0x2b, 0xf6, 0x78, 0xec, 0xd8, 0x4a, 0xe2, 0x24, 0xfe, 0xf5, - 0x17, 0x45, 0x60, 0x20, 0x76, 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 0x65, + 0x48, 0xa5, 0x49, 0x37, 0x04, 0x25, 0x4d, 0x64, 0x36, 0x94, 0xa8, 0x72, 0x46, 0x49, 0x94, 0xa7, + 0x68, 0xf3, 0x0c, 0x5d, 0xb6, 0x45, 0xef, 0x7d, 0x85, 0xde, 0xd7, 0x7d, 0x84, 0x02, 0xdd, 0x36, + 0x6d, 0xd1, 0x6e, 0x8a, 0x21, 0x29, 0x8b, 0x16, 0xe4, 0x1d, 0xcf, 0x77, 0xce, 0xf9, 0xce, 0x77, + 0xbe, 0x19, 0x92, 0xb0, 0xda, 0x89, 0xfa, 0xfd, 0x68, 0x70, 0x38, 0x8c, 0x23, 0x11, 0xe1, 0xad, + 0x7e, 0x10, 0x3e, 0x19, 0xf1, 0x34, 0x3a, 0x4c, 0x53, 0x95, 0x25, 0x58, 0x20, 0xfd, 0xa1, 0x18, + 0x57, 0x3c, 0x58, 0x74, 0x84, 0x2f, 0x46, 0x1c, 0xdf, 0x01, 0x60, 0x71, 0x1c, 0xc5, 0x5e, 0x27, + 0xea, 0xb2, 0xb2, 0xb2, 0xaf, 0xdc, 0x5a, 0x7f, 0xfd, 0xc6, 0xe1, 0x9c, 0xe6, 0x43, 0x22, 0xcb, + 0xb4, 0xa8, 0xcb, 0xa8, 0xca, 0x26, 0x8f, 0x78, 0x07, 0x16, 0x63, 0xe6, 0xf3, 0x68, 0x50, 0x2e, + 0xec, 0x2b, 0xb7, 0x54, 0x9a, 0x45, 0x95, 0x37, 0x61, 0xf5, 0x2e, 0x1b, 0xdf, 0xf7, 0xc3, 0x11, + 0x6b, 0xfa, 0x41, 0x8c, 0x11, 0x14, 0x1f, 0xb3, 0x71, 0xc2, 0xaf, 0x52, 0xf9, 0x88, 0xb7, 0x61, + 0xe1, 0x89, 0x4c, 0x67, 0x8d, 0x69, 0x50, 0xd9, 0x83, 0xd2, 0x71, 0x18, 0xb5, 0xa7, 0x59, 0xd9, + 0xb1, 0x3a, 0xc9, 0xde, 0x86, 0xa5, 0x6a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xb6, 0xa2, 0x2e, 0x93, 0xad, 0x1c, 0x7d, 0xae, 0xca, + 0xd5, 0xa4, 0xad, 0xe9, 0x6a, 0x5f, 0x24, 0x31, 0x65, 0xef, 0x8f, 0x18, 0x17, 0x86, 0x8e, 0xbe, + 0x54, 0xf1, 0x06, 0x40, 0x16, 0xbb, 0x8e, 0x8d, 0xbe, 0x52, 0xa5, 0x8f, 0xd5, 0x30, 0x8c, 0x3a, + 0xbe, 0x38, 0xf3, 0xf1, 0x6b, 0x55, 0x1e, 0x44, 0xee, 0xcd, 0xc9, 0x44, 0x7d, 0xa3, 0xe2, 0xcb, + 0x80, 0xf2, 0x97, 0x5e, 0x97, 0x17, 0xfc, 0x5b, 0xf5, 0xf8, 0xf8, 0xdd, 0xb7, 0x7b, 0x81, 0x38, + 0x1d, 0xb5, 0xe5, 0xcf, 0xf9, 0xe8, 0x79, 0x10, 0x86, 0xc1, 0x73, 0xc1, 0x3a, 0xa7, 0x47, 0xe9, + 0x8f, 0xfb, 0x76, 0x37, 0xe0, 0x22, 0x0e, 0xda, 0x23, 0xc1, 0xba, 0x47, 0xc1, 0x40, 0xb0, 0x78, + 0xe0, 0x87, 0x47, 0xc9, 0xdf, 0xfc, 0x28, 0xfd, 0x9b, 0x0f, 0xdb, 0xed, 0xc5, 0x24, 0x7e, 0xe3, + 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x3e, 0x02, 0x01, 0xb0, 0x09, 0x00, 0x00, } diff --git a/internal/proxynode/impl.go b/internal/proxynode/impl.go index 02d81c5a7..20029fd07 100644 --- a/internal/proxynode/impl.go +++ b/internal/proxynode/impl.go @@ -596,7 +596,7 @@ func (node *ProxyNode) Insert(ctx context.Context, request *milvuspb.InsertReque }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 0, }, CollectionName: request.CollectionName, @@ -640,7 +640,7 @@ func (node *ProxyNode) Search(ctx context.Context, request *milvuspb.SearchReque Condition: NewTaskCondition(ctx), SearchRequest: &internalpb2.SearchRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearch, + MsgType: commonpb.MsgType_Search, SourceID: Params.ProxyID, }, ResultChannelID: strconv.FormatInt(Params.ProxyID, 10), @@ -718,7 +718,7 @@ func (node *ProxyNode) GetPersistentSegmentInfo(ctx context.Context, req *milvus } infoResp, err := node.dataService.GetSegmentInfo(ctx, &datapb.SegmentInfoRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentInfo, + MsgType: commonpb.MsgType_SegmentInfo, MsgID: 0, Timestamp: 0, SourceID: Params.ProxyID, @@ -765,7 +765,7 @@ func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.Qu } infoResp, err := node.queryService.GetSegmentInfo(ctx, &querypb.SegmentInfoRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSegmentInfo, + MsgType: commonpb.MsgType_SegmentInfo, MsgID: 0, Timestamp: 0, SourceID: Params.ProxyID, @@ -800,7 +800,7 @@ func (node *ProxyNode) GetQuerySegmentInfo(ctx context.Context, req *milvuspb.Qu func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName string, collectionName string) ([]UniqueID, error) { describeCollectionResponse, err := node.masterService.DescribeCollection(ctx, &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, MsgID: 0, Timestamp: 0, SourceID: Params.ProxyID, @@ -817,7 +817,7 @@ func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName strin collectionID := describeCollectionResponse.CollectionID showPartitionsResp, err := node.masterService.ShowPartitions(ctx, &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, MsgID: 0, Timestamp: 0, SourceID: Params.ProxyID, @@ -837,7 +837,7 @@ func (node *ProxyNode) getSegmentsOfCollection(ctx context.Context, dbName strin for _, partitionID := range showPartitionsResp.PartitionIDs { showSegmentResponse, err := node.masterService.ShowSegments(ctx, &milvuspb.ShowSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowSegment, + MsgType: commonpb.MsgType_ShowSegments, MsgID: 0, Timestamp: 0, SourceID: Params.ProxyID, diff --git a/internal/proxynode/meta_cache.go b/internal/proxynode/meta_cache.go index 37d684225..8e27d6ef8 100644 --- a/internal/proxynode/meta_cache.go +++ b/internal/proxynode/meta_cache.go @@ -100,7 +100,7 @@ func (m *MetaCache) GetCollectionID(ctx context.Context, collectionName string) req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, }, CollectionName: collectionName, } @@ -131,7 +131,7 @@ func (m *MetaCache) GetCollectionSchema(ctx context.Context, collectionName stri req := &milvuspb.DescribeCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeCollection, + MsgType: commonpb.MsgType_DescribeCollection, }, CollectionName: collectionName, } @@ -163,7 +163,7 @@ func (m *MetaCache) GetPartitionID(ctx context.Context, collectionName string, p req := &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, }, CollectionName: collectionName, } diff --git a/internal/proxynode/repack_func.go b/internal/proxynode/repack_func.go index 893c44e73..8db3f2f8f 100644 --- a/internal/proxynode/repack_func.go +++ b/internal/proxynode/repack_func.go @@ -25,7 +25,7 @@ func insertRepackFunc(tsMsgs []msgstream.TsMsg, channelNamesMap := make(map[UniqueID][]string) // collectionID --> channelNames for i, request := range tsMsgs { - if request.Type() != commonpb.MsgType_kInsert { + if request.Type() != commonpb.MsgType_Insert { return nil, errors.New("msg's must be Insert") } insertRequest, ok := request.(*msgstream.InsertMsg) @@ -241,7 +241,7 @@ func insertRepackFunc(tsMsgs []msgstream.TsMsg, channelID := channelNames[int(key)%len(channelNames)] sliceRequest := internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: reqID, Timestamp: ts, SourceID: proxyID, diff --git a/internal/proxynode/task.go b/internal/proxynode/task.go index a26179c27..f2a5ae6f0 100644 --- a/internal/proxynode/task.go +++ b/internal/proxynode/task.go @@ -119,7 +119,7 @@ func (it *InsertTask) OnEnqueue() error { } func (it *InsertTask) PreExecute(ctx context.Context) error { - it.Base.MsgType = commonpb.MsgType_kInsert + it.Base.MsgType = commonpb.MsgType_Insert it.Base.SourceID = Params.ProxyID collectionName := it.BaseInsertTask.CollectionName @@ -201,9 +201,9 @@ func (it *InsertTask) Execute(ctx context.Context) error { if err != nil { resp, _ := it.dataService.GetInsertChannels(ctx, &datapb.InsertChannelRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, // todo - MsgID: it.Base.MsgID, // todo - Timestamp: 0, // todo + MsgType: commonpb.MsgType_Insert, // todo + MsgID: it.Base.MsgID, // todo + Timestamp: 0, // todo SourceID: Params.ProxyID, }, DbID: 0, // todo @@ -289,7 +289,7 @@ func (cct *CreateCollectionTask) OnEnqueue() error { } func (cct *CreateCollectionTask) PreExecute(ctx context.Context) error { - cct.Base.MsgType = commonpb.MsgType_kCreateCollection + cct.Base.MsgType = commonpb.MsgType_CreateCollection cct.Base.SourceID = Params.ProxyID cct.schema = &schemapb.CollectionSchema{} @@ -365,9 +365,9 @@ func (cct *CreateCollectionTask) Execute(ctx context.Context) error { } resp, _ := cct.dataServiceClient.GetInsertChannels(ctx, &datapb.InsertChannelRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, // todo - MsgID: cct.Base.MsgID, // todo - Timestamp: 0, // todo + MsgType: commonpb.MsgType_Insert, // todo + MsgID: cct.Base.MsgID, // todo + Timestamp: 0, // todo SourceID: Params.ProxyID, }, DbID: 0, // todo @@ -437,7 +437,7 @@ func (dct *DropCollectionTask) OnEnqueue() error { } func (dct *DropCollectionTask) PreExecute(ctx context.Context) error { - dct.Base.MsgType = commonpb.MsgType_kDropCollection + dct.Base.MsgType = commonpb.MsgType_DropCollection dct.Base.SourceID = Params.ProxyID if err := ValidateCollectionName(dct.CollectionName); err != nil { @@ -517,7 +517,7 @@ func (st *SearchTask) OnEnqueue() error { } func (st *SearchTask) PreExecute(ctx context.Context) error { - st.Base.MsgType = commonpb.MsgType_kSearch + st.Base.MsgType = commonpb.MsgType_Search st.Base.SourceID = Params.ProxyID collectionName := st.query.CollectionName @@ -535,7 +535,7 @@ func (st *SearchTask) PreExecute(ctx context.Context) error { return err } } - st.Base.MsgType = commonpb.MsgType_kSearch + st.Base.MsgType = commonpb.MsgType_Search queryBytes, err := proto.Marshal(st.query) if err != nil { return err @@ -787,7 +787,7 @@ func (hct *HasCollectionTask) OnEnqueue() error { } func (hct *HasCollectionTask) PreExecute(ctx context.Context) error { - hct.Base.MsgType = commonpb.MsgType_kHasCollection + hct.Base.MsgType = commonpb.MsgType_HasCollection hct.Base.SourceID = Params.ProxyID if err := ValidateCollectionName(hct.CollectionName); err != nil { @@ -858,7 +858,7 @@ func (dct *DescribeCollectionTask) OnEnqueue() error { } func (dct *DescribeCollectionTask) PreExecute(ctx context.Context) error { - dct.Base.MsgType = commonpb.MsgType_kDescribeCollection + dct.Base.MsgType = commonpb.MsgType_DescribeCollection dct.Base.SourceID = Params.ProxyID if err := ValidateCollectionName(dct.CollectionName); err != nil { @@ -929,7 +929,7 @@ func (g *GetCollectionsStatisticsTask) OnEnqueue() error { } func (g *GetCollectionsStatisticsTask) PreExecute(ctx context.Context) error { - g.Base.MsgType = commonpb.MsgType_kGetCollectionStatistics + g.Base.MsgType = commonpb.MsgType_GetCollectionStatistics g.Base.SourceID = Params.ProxyID return nil } @@ -941,7 +941,7 @@ func (g *GetCollectionsStatisticsTask) Execute(ctx context.Context) error { } req := &datapb.CollectionStatsRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kGetCollectionStatistics, + MsgType: commonpb.MsgType_GetCollectionStatistics, MsgID: g.Base.MsgID, Timestamp: g.Base.Timestamp, SourceID: g.Base.SourceID, @@ -1016,7 +1016,7 @@ func (sct *ShowCollectionsTask) OnEnqueue() error { } func (sct *ShowCollectionsTask) PreExecute(ctx context.Context) error { - sct.Base.MsgType = commonpb.MsgType_kShowCollections + sct.Base.MsgType = commonpb.MsgType_ShowCollections sct.Base.SourceID = Params.ProxyID return nil @@ -1084,7 +1084,7 @@ func (cpt *CreatePartitionTask) OnEnqueue() error { } func (cpt *CreatePartitionTask) PreExecute(ctx context.Context) error { - cpt.Base.MsgType = commonpb.MsgType_kCreatePartition + cpt.Base.MsgType = commonpb.MsgType_CreatePartition cpt.Base.SourceID = Params.ProxyID collName, partitionTag := cpt.CollectionName, cpt.PartitionName @@ -1161,7 +1161,7 @@ func (dpt *DropPartitionTask) OnEnqueue() error { } func (dpt *DropPartitionTask) PreExecute(ctx context.Context) error { - dpt.Base.MsgType = commonpb.MsgType_kDropPartition + dpt.Base.MsgType = commonpb.MsgType_DropPartition dpt.Base.SourceID = Params.ProxyID collName, partitionTag := dpt.CollectionName, dpt.PartitionName @@ -1238,7 +1238,7 @@ func (hpt *HasPartitionTask) OnEnqueue() error { } func (hpt *HasPartitionTask) PreExecute(ctx context.Context) error { - hpt.Base.MsgType = commonpb.MsgType_kHasPartition + hpt.Base.MsgType = commonpb.MsgType_HasPartition hpt.Base.SourceID = Params.ProxyID collName, partitionTag := hpt.CollectionName, hpt.PartitionName @@ -1314,7 +1314,7 @@ func (spt *ShowPartitionsTask) OnEnqueue() error { } func (spt *ShowPartitionsTask) PreExecute(ctx context.Context) error { - spt.Base.MsgType = commonpb.MsgType_kShowPartitions + spt.Base.MsgType = commonpb.MsgType_ShowPartitions spt.Base.SourceID = Params.ProxyID if err := ValidateCollectionName(spt.CollectionName); err != nil { @@ -1385,7 +1385,7 @@ func (cit *CreateIndexTask) OnEnqueue() error { } func (cit *CreateIndexTask) PreExecute(ctx context.Context) error { - cit.Base.MsgType = commonpb.MsgType_kCreateIndex + cit.Base.MsgType = commonpb.MsgType_CreateIndex cit.Base.SourceID = Params.ProxyID collName, fieldName := cit.CollectionName, cit.FieldName @@ -1463,7 +1463,7 @@ func (dit *DescribeIndexTask) OnEnqueue() error { } func (dit *DescribeIndexTask) PreExecute(ctx context.Context) error { - dit.Base.MsgType = commonpb.MsgType_kDescribeIndex + dit.Base.MsgType = commonpb.MsgType_DescribeIndex dit.Base.SourceID = Params.ProxyID collName, fieldName := dit.CollectionName, dit.FieldName @@ -1546,7 +1546,7 @@ func (dit *DropIndexTask) OnEnqueue() error { } func (dit *DropIndexTask) PreExecute(ctx context.Context) error { - dit.Base.MsgType = commonpb.MsgType_kDropIndex + dit.Base.MsgType = commonpb.MsgType_DropIndex dit.Base.SourceID = Params.ProxyID collName, fieldName := dit.CollectionName, dit.FieldName @@ -1625,7 +1625,7 @@ func (gist *GetIndexStateTask) OnEnqueue() error { } func (gist *GetIndexStateTask) PreExecute(ctx context.Context) error { - gist.Base.MsgType = commonpb.MsgType_kGetIndexState + gist.Base.MsgType = commonpb.MsgType_GetIndexState gist.Base.SourceID = Params.ProxyID collName, fieldName := gist.CollectionName, gist.FieldName @@ -1650,7 +1650,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error { showPartitionRequest := &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, MsgID: gist.Base.MsgID, Timestamp: gist.Base.Timestamp, SourceID: Params.ProxyID, @@ -1670,7 +1670,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error { describeIndexReq := milvuspb.DescribeIndexRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeIndex, + MsgType: commonpb.MsgType_DescribeIndex, MsgID: gist.Base.MsgID, Timestamp: gist.Base.Timestamp, SourceID: Params.ProxyID, @@ -1703,7 +1703,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error { for _, partitionID := range partitions.PartitionIDs { showSegmentsRequest := &milvuspb.ShowSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowSegment, + MsgType: commonpb.MsgType_ShowSegments, MsgID: gist.Base.MsgID, Timestamp: gist.Base.Timestamp, SourceID: Params.ProxyID, @@ -1730,7 +1730,7 @@ func (gist *GetIndexStateTask) Execute(ctx context.Context) error { for _, segmentID := range allSegmentIDs { describeSegmentRequest := &milvuspb.DescribeSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeSegment, + MsgType: commonpb.MsgType_DescribeSegment, MsgID: gist.Base.MsgID, Timestamp: gist.Base.Timestamp, SourceID: Params.ProxyID, @@ -1856,7 +1856,7 @@ func (ft *FlushTask) OnEnqueue() error { } func (ft *FlushTask) PreExecute(ctx context.Context) error { - ft.Base.MsgType = commonpb.MsgType_kFlush + ft.Base.MsgType = commonpb.MsgType_Flush ft.Base.SourceID = Params.ProxyID return nil } @@ -1869,7 +1869,7 @@ func (ft *FlushTask) Execute(ctx context.Context) error { } flushReq := &datapb.FlushRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kFlush, + MsgType: commonpb.MsgType_Flush, MsgID: ft.Base.MsgID, Timestamp: ft.Base.Timestamp, SourceID: ft.Base.SourceID, @@ -1942,7 +1942,7 @@ func (lct *LoadCollectionTask) OnEnqueue() error { } func (lct *LoadCollectionTask) PreExecute(ctx context.Context) error { - lct.Base.MsgType = commonpb.MsgType_kLoadCollection + lct.Base.MsgType = commonpb.MsgType_LoadCollection lct.Base.SourceID = Params.ProxyID collName := lct.CollectionName @@ -1966,7 +1966,7 @@ func (lct *LoadCollectionTask) Execute(ctx context.Context) (err error) { request := &querypb.LoadCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kLoadCollection, + MsgType: commonpb.MsgType_LoadCollection, MsgID: lct.Base.MsgID, Timestamp: lct.Base.Timestamp, SourceID: lct.Base.SourceID, @@ -2029,7 +2029,7 @@ func (rct *ReleaseCollectionTask) OnEnqueue() error { } func (rct *ReleaseCollectionTask) PreExecute(ctx context.Context) error { - rct.Base.MsgType = commonpb.MsgType_kReleaseCollection + rct.Base.MsgType = commonpb.MsgType_ReleaseCollection rct.Base.SourceID = Params.ProxyID collName := rct.CollectionName @@ -2048,7 +2048,7 @@ func (rct *ReleaseCollectionTask) Execute(ctx context.Context) (err error) { } request := &querypb.ReleaseCollectionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kReleaseCollection, + MsgType: commonpb.MsgType_ReleaseCollection, MsgID: rct.Base.MsgID, Timestamp: rct.Base.Timestamp, SourceID: rct.Base.SourceID, @@ -2106,7 +2106,7 @@ func (lpt *LoadPartitionTask) OnEnqueue() error { } func (lpt *LoadPartitionTask) PreExecute(ctx context.Context) error { - lpt.Base.MsgType = commonpb.MsgType_kLoadPartition + lpt.Base.MsgType = commonpb.MsgType_LoadPartitions lpt.Base.SourceID = Params.ProxyID collName := lpt.CollectionName @@ -2137,7 +2137,7 @@ func (lpt *LoadPartitionTask) Execute(ctx context.Context) error { } request := &querypb.LoadPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kLoadPartition, + MsgType: commonpb.MsgType_LoadPartitions, MsgID: lpt.Base.MsgID, Timestamp: lpt.Base.Timestamp, SourceID: lpt.Base.SourceID, @@ -2201,7 +2201,7 @@ func (rpt *ReleasePartitionTask) OnEnqueue() error { } func (rpt *ReleasePartitionTask) PreExecute(ctx context.Context) error { - rpt.Base.MsgType = commonpb.MsgType_kReleasePartition + rpt.Base.MsgType = commonpb.MsgType_ReleasePartitions rpt.Base.SourceID = Params.ProxyID collName := rpt.CollectionName @@ -2228,7 +2228,7 @@ func (rpt *ReleasePartitionTask) Execute(ctx context.Context) (err error) { } request := &querypb.ReleasePartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kReleasePartition, + MsgType: commonpb.MsgType_ReleasePartitions, MsgID: rpt.Base.MsgID, Timestamp: rpt.Base.Timestamp, SourceID: rpt.Base.SourceID, diff --git a/internal/proxynode/timetick.go b/internal/proxynode/timetick.go index 838238089..60e7c306c 100644 --- a/internal/proxynode/timetick.go +++ b/internal/proxynode/timetick.go @@ -78,7 +78,7 @@ func (tt *timeTick) tick() error { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: tt.currentTick, SourceID: tt.peerID, diff --git a/internal/proxyservice/timetick.go b/internal/proxyservice/timetick.go index 64321b7e8..924b1407d 100644 --- a/internal/proxyservice/timetick.go +++ b/internal/proxyservice/timetick.go @@ -43,7 +43,7 @@ func (tt *TimeTick) Start() error { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: current, SourceID: 0, diff --git a/internal/querynode/data_sync_service_test.go b/internal/querynode/data_sync_service_test.go index f2f2ad8a8..d4b5a4d5d 100644 --- a/internal/querynode/data_sync_service_test.go +++ b/internal/querynode/data_sync_service_test.go @@ -59,7 +59,7 @@ func TestDataSyncService_Start(t *testing.T) { }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 0, Timestamp: uint64(i + 1000), SourceID: 0, @@ -94,7 +94,7 @@ func TestDataSyncService_Start(t *testing.T) { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: math.MaxUint64, SourceID: 0, diff --git a/internal/querynode/flow_graph_filter_dm_node.go b/internal/querynode/flow_graph_filter_dm_node.go index 50c7ac00f..31008629f 100644 --- a/internal/querynode/flow_graph_filter_dm_node.go +++ b/internal/querynode/flow_graph_filter_dm_node.go @@ -42,7 +42,7 @@ func (fdmNode *filterDmNode) Operate(ctx context.Context, in []Msg) ([]Msg, cont } for _, msg := range msgStreamMsg.TsMessages() { switch msg.Type() { - case commonpb.MsgType_kInsert: + case commonpb.MsgType_Insert: resMsg := fdmNode.filterInvalidInsertMessage(msg.(*msgstream.InsertMsg)) if resMsg != nil { iMsg.insertMessages = append(iMsg.insertMessages, resMsg) diff --git a/internal/querynode/flow_graph_service_time_node.go b/internal/querynode/flow_graph_service_time_node.go index cd59e677c..033e9b57e 100644 --- a/internal/querynode/flow_graph_service_time_node.go +++ b/internal/querynode/flow_graph_service_time_node.go @@ -60,7 +60,7 @@ func (stNode *serviceTimeNode) sendTimeTick(ts Timestamp) error { }, TimeTickMsg: internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: ts, SourceID: Params.QueryNodeID, diff --git a/internal/querynode/index_loader.go b/internal/querynode/index_loader.go index b669c6119..f015217f6 100644 --- a/internal/querynode/index_loader.go +++ b/internal/querynode/index_loader.go @@ -312,7 +312,7 @@ func (loader *indexLoader) getIndexInfo(collectionID UniqueID, segmentID UniqueI ctx := context.TODO() req := &milvuspb.DescribeSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kDescribeSegment, + MsgType: commonpb.MsgType_DescribeSegment, }, CollectionID: collectionID, SegmentID: segmentID, diff --git a/internal/querynode/load_service_test.go b/internal/querynode/load_service_test.go index 3a70057f5..61177896b 100644 --- a/internal/querynode/load_service_test.go +++ b/internal/querynode/load_service_test.go @@ -964,7 +964,7 @@ func doInsert(ctx context.Context, collectionID UniqueID, partitionID UniqueID, }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: 0, Timestamp: uint64(i + 1000), SourceID: 0, @@ -998,7 +998,7 @@ func doInsert(ctx context.Context, collectionID UniqueID, partitionID UniqueID, } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: 1000, SourceID: 0, @@ -1064,7 +1064,7 @@ func sentTimeTick(ctx context.Context) error { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: math.MaxUint64, SourceID: 0, diff --git a/internal/querynode/query_node.go b/internal/querynode/query_node.go index e794c703a..8f3644d76 100644 --- a/internal/querynode/query_node.go +++ b/internal/querynode/query_node.go @@ -108,7 +108,7 @@ func (node *QueryNode) Init() error { ctx := context.Background() registerReq := &queryPb.RegisterNodeRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kNone, + MsgType: commonpb.MsgType_None, SourceID: Params.QueryNodeID, }, Address: &commonpb.Address{ diff --git a/internal/querynode/search_service.go b/internal/querynode/search_service.go index 070f0788c..a80c5ce91 100644 --- a/internal/querynode/search_service.go +++ b/internal/querynode/search_service.go @@ -299,7 +299,7 @@ func (ss *searchService) search(msg msgstream.TsMsg) error { BaseMsg: msgstream.BaseMsg{HashValues: []uint32{uint32(resultChannelInt)}}, SearchResults: internalpb2.SearchResults{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearchResult, + MsgType: commonpb.MsgType_SearchResult, MsgID: searchMsg.Base.MsgID, Timestamp: searchTimestamp, SourceID: searchMsg.Base.SourceID, @@ -361,7 +361,7 @@ func (ss *searchService) search(msg msgstream.TsMsg) error { BaseMsg: msgstream.BaseMsg{HashValues: []uint32{uint32(resultChannelInt)}}, SearchResults: internalpb2.SearchResults{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearchResult, + MsgType: commonpb.MsgType_SearchResult, MsgID: searchMsg.Base.MsgID, Timestamp: searchTimestamp, SourceID: searchMsg.Base.SourceID, @@ -422,7 +422,7 @@ func (ss *searchService) publishFailedSearchResult(msg msgstream.TsMsg, errMsg s BaseMsg: msgstream.BaseMsg{HashValues: []uint32{uint32(resultChannelInt)}}, SearchResults: internalpb2.SearchResults{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearchResult, + MsgType: commonpb.MsgType_SearchResult, MsgID: searchMsg.Base.MsgID, Timestamp: searchMsg.Base.Timestamp, SourceID: searchMsg.Base.SourceID, diff --git a/internal/querynode/search_service_test.go b/internal/querynode/search_service_test.go index 4fea8dede..0b0097987 100644 --- a/internal/querynode/search_service_test.go +++ b/internal/querynode/search_service_test.go @@ -82,7 +82,7 @@ func TestSearch_Search(t *testing.T) { }, SearchRequest: internalpb2.SearchRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearch, + MsgType: commonpb.MsgType_Search, MsgID: 1, Timestamp: uint64(10 + 1000), SourceID: 1, @@ -138,7 +138,7 @@ func TestSearch_Search(t *testing.T) { }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: int64(i), Timestamp: uint64(10 + 1000), SourceID: 0, @@ -172,7 +172,7 @@ func TestSearch_Search(t *testing.T) { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: math.MaxUint64, SourceID: 0, @@ -288,7 +288,7 @@ func TestSearch_SearchMultiSegments(t *testing.T) { }, SearchRequest: internalpb2.SearchRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kSearch, + MsgType: commonpb.MsgType_Search, MsgID: 1, Timestamp: uint64(10 + 1000), SourceID: 1, @@ -340,7 +340,7 @@ func TestSearch_SearchMultiSegments(t *testing.T) { }, InsertRequest: internalpb2.InsertRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kInsert, + MsgType: commonpb.MsgType_Insert, MsgID: int64(i), Timestamp: uint64(i + 1000), SourceID: 0, @@ -374,7 +374,7 @@ func TestSearch_SearchMultiSegments(t *testing.T) { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: math.MaxUint64, SourceID: 0, diff --git a/internal/querynode/stats_service.go b/internal/querynode/stats_service.go index b4eacadbc..b6b9adf7a 100644 --- a/internal/querynode/stats_service.go +++ b/internal/querynode/stats_service.go @@ -74,7 +74,7 @@ func (sService *statsService) publicStatistic(fieldStats []*internalpb2.FieldSta queryNodeStats := internalpb2.QueryNodeStats{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kQueryNodeStats, + MsgType: commonpb.MsgType_QueryNodeStats, SourceID: Params.QueryNodeID, }, SegStats: segStats, diff --git a/internal/queryservice/queryservice.go b/internal/queryservice/queryservice.go index d9f5ea4ec..7120c9c3c 100644 --- a/internal/queryservice/queryservice.go +++ b/internal/queryservice/queryservice.go @@ -279,7 +279,7 @@ func (qs *QueryService) LoadCollection(ctx context.Context, req *querypb.LoadCol // get partitionIDs showPartitionRequest := &milvuspb.ShowPartitionRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowPartitions, + MsgType: commonpb.MsgType_ShowPartitions, }, CollectionID: collectionID, } @@ -442,7 +442,7 @@ func (qs *QueryService) LoadPartitions(ctx context.Context, req *querypb.LoadPar showSegmentRequest := &milvuspb.ShowSegmentRequest{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kShowSegment, + MsgType: commonpb.MsgType_ShowSegments, }, CollectionID: collectionID, PartitionID: partitionID, diff --git a/internal/timesync/time_sync_producer.go b/internal/timesync/time_sync_producer.go index 6b661f3fc..36d662534 100644 --- a/internal/timesync/time_sync_producer.go +++ b/internal/timesync/time_sync_producer.go @@ -48,7 +48,7 @@ func (producer *MsgProducer) broadcastMsg() { } timeTickResult := internalpb2.TimeTickMsg{ Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_kTimeTick, + MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: tt, SourceID: 0, diff --git a/internal/util/trace/util.go b/internal/util/trace/util.go index 9816fc5d4..7caf39d88 100644 --- a/internal/util/trace/util.go +++ b/internal/util/trace/util.go @@ -187,9 +187,9 @@ func allowTrace(in interface{}) bool { } switch res := in.(type) { case msgstream.TsMsg: - return !(res.Type() == commonpb.MsgType_kTimeTick || - res.Type() == commonpb.MsgType_kQueryNodeStats || - res.Type() == commonpb.MsgType_kLoadIndex) + return !(res.Type() == commonpb.MsgType_TimeTick || + res.Type() == commonpb.MsgType_QueryNodeStats || + res.Type() == commonpb.MsgType_LoadIndex) default: return false } -- GitLab