diff --git a/configs/milvus.yaml b/configs/milvus.yaml index 42860387dd19a43cd3b4ca9dc633378969340de1..ce0fccfd025509f16c47542f0beb239dcfae683c 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -29,7 +29,7 @@ minio: accessKeyID: minioadmin secretAccessKey: minioadmin useSSL: false - bucketName: "A-bucket" + bucketName: "a-bucket" pulsar: address: localhost diff --git a/internal/core/src/segcore/plan_c.cpp b/internal/core/src/segcore/plan_c.cpp index b3cb53543aac8a03dc1e26b9b8d4b3741d5b02de..0fe80580cf506a040dd2a710d81c555f911face7 100644 --- a/internal/core/src/segcore/plan_c.cpp +++ b/internal/core/src/segcore/plan_c.cpp @@ -75,12 +75,6 @@ GetTopK(CPlan plan) { return res; } -const char* -GetMetricType(CPlan plan) { - auto query_plan = static_cast<milvus::query::Plan*>(plan); - return strdup(query_plan->plan_node_->query_info_.metric_type_.c_str()); -} - void DeletePlan(CPlan cPlan) { auto plan = (milvus::query::Plan*)cPlan; diff --git a/internal/core/src/segcore/plan_c.h b/internal/core/src/segcore/plan_c.h index ce12e9958593da6c8321084efba53c684cfc1ec7..8f995f22a5f942d3cbe9e52d91b314560d58c4f0 100644 --- a/internal/core/src/segcore/plan_c.h +++ b/internal/core/src/segcore/plan_c.h @@ -35,9 +35,6 @@ GetNumOfQueries(CPlaceholderGroup placeholder_group); int64_t GetTopK(CPlan plan); -const char* -GetMetricType(CPlan plan); - void DeletePlan(CPlan plan); diff --git a/internal/core/src/segcore/reduce_c.cpp b/internal/core/src/segcore/reduce_c.cpp index ff12ffeafb9c09e437261a34f461b995a97c95be..8e06936888c8583b8fc951c7f92852435ce2af30 100644 --- a/internal/core/src/segcore/reduce_c.cpp +++ b/internal/core/src/segcore/reduce_c.cpp @@ -64,11 +64,6 @@ struct SearchResultPair { return (distance_ < pair.distance_); } - bool - operator>(const SearchResultPair& pair) const { - return (distance_ > pair.distance_); - } - void reset_distance() { distance_ = search_result_->result_distances_[offset_]; @@ -94,7 +89,7 @@ GetResultData(std::vector<std::vector<int64_t>>& search_records, AssertInfo(topk > 0, "topK must greater than 0"); for (int i = 0; i < topk; ++i) { result_pairs[0].reset_distance(); - std::sort(result_pairs.begin(), result_pairs.end(), std::greater<>()); + std::sort(result_pairs.begin(), result_pairs.end()); auto& result_pair = result_pairs[0]; auto index = result_pair.index_; is_selected[index] = true; diff --git a/internal/core/src/segcore/segment_c.cpp b/internal/core/src/segcore/segment_c.cpp index 182301c7b7edb06cf4b48c6238d8f2fccc4a00e6..6a95a622b27301f084f699a08452734bc8382481 100644 --- a/internal/core/src/segcore/segment_c.cpp +++ b/internal/core/src/segcore/segment_c.cpp @@ -140,11 +140,6 @@ Search(CSegmentBase c_segment, auto status = CStatus(); try { auto res = segment->Search(plan, placeholder_groups.data(), timestamps, num_groups, *query_result); - if (plan->plan_node_->query_info_.metric_type_ != "IP") { - for (auto& dis : query_result->result_distances_) { - dis *= -1; - } - } status.error_code = Success; status.error_msg = ""; } catch (std::exception& e) { diff --git a/internal/proto/internal_msg.proto b/internal/proto/internal_msg.proto index cb934231a2acdce48430f9355f4707dea9ccfd82..b9961e309a0d8e0ed5000b2c119ffdaf24f46a0e 100644 --- a/internal/proto/internal_msg.proto +++ b/internal/proto/internal_msg.proto @@ -259,7 +259,6 @@ message SearchResult { uint64 timestamp = 6; int64 result_channelID = 7; repeated bytes hits = 8; - string metric_type = 9; } message TimeTickMsg { diff --git a/internal/proto/internalpb/internal_msg.pb.go b/internal/proto/internalpb/internal_msg.pb.go index d159b04dde1455ca0828481abee5a287c49a72c4..4432e64492b45460635aae0eccaa7d107aff2480 100644 --- a/internal/proto/internalpb/internal_msg.pb.go +++ b/internal/proto/internalpb/internal_msg.pb.go @@ -1728,7 +1728,6 @@ type SearchResult struct { Timestamp uint64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` ResultChannelID int64 `protobuf:"varint,7,opt,name=result_channelID,json=resultChannelID,proto3" json:"result_channelID,omitempty"` Hits [][]byte `protobuf:"bytes,8,rep,name=hits,proto3" json:"hits,omitempty"` - MetricType string `protobuf:"bytes,9,opt,name=metric_type,json=metricType,proto3" json:"metric_type,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1815,13 +1814,6 @@ func (m *SearchResult) GetHits() [][]byte { return nil } -func (m *SearchResult) GetMetricType() string { - if m != nil { - return m.MetricType - } - return "" -} - type TimeTickMsg struct { MsgType MsgType `protobuf:"varint,1,opt,name=msg_type,json=msgType,proto3,enum=milvus.proto.internal.MsgType" json:"msg_type,omitempty"` PeerID int64 `protobuf:"varint,2,opt,name=peerID,proto3" json:"peerID,omitempty"` @@ -2661,121 +2653,120 @@ func init() { func init() { proto.RegisterFile("internal_msg.proto", fileDescriptor_7eb37f6b80b23116) } var fileDescriptor_7eb37f6b80b23116 = []byte{ - // 1852 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x99, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0xc0, 0xb7, 0xbb, 0xfd, 0x11, 0x3f, 0x3b, 0x4e, 0x4f, 0x25, 0x99, 0xf1, 0xec, 0x2c, 0x3b, - 0x99, 0x1e, 0xc4, 0x86, 0x45, 0x24, 0x90, 0xe1, 0xc0, 0xde, 0x20, 0xb1, 0x96, 0x35, 0x43, 0x46, - 0xa1, 0x13, 0x2d, 0x12, 0x5a, 0xa9, 0xd5, 0xb1, 0x5f, 0xec, 0x52, 0x7f, 0x39, 0x55, 0xed, 0x49, - 0x3c, 0x07, 0x24, 0xc4, 0x9c, 0x11, 0x1f, 0xe2, 0xc0, 0x8d, 0x3b, 0xec, 0x8a, 0x05, 0xf1, 0x3f, - 0xf0, 0x29, 0x24, 0xfe, 0x0b, 0x38, 0x80, 0xc4, 0x2e, 0x07, 0x6e, 0xa8, 0xaa, 0xfa, 0xc3, 0x9d, - 0xd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af, 0x6b, 0x52, 0xeb, 0xe2, 0x56, 0x61, 0xbe, - 0x5f, 0x23, 0x4b, 0x00, 0x5e, 0x76, 0xec, 0x31, 0x7f, 0x53, 0x7b, 0xfd, 0x0d, 0x58, 0x48, 0xff, - 0x3f, 0x24, 0x00, 0x95, 0x5d, 0x97, 0xc7, 0xc8, 0xcc, 0x97, 0xc4, 0xb3, 0x8d, 0x6e, 0x0f, 0x99, - 0xa9, 0x89, 0xe7, 0xef, 0x30, 0x2a, 0xe4, 0xba, 0xf0, 0xf9, 0x9e, 0x08, 0x4c, 0xd3, 0xd8, 0x6e, - 0x7f, 0x77, 0xbb, 0x4f, 0xe3, 0xc1, 0xe8, 0x50, 0x44, 0xcd, 0xe6, 0x13, 0xea, 0xfb, 0xf4, 0x49, - 0x8c, 0xdd, 0xc1, 0xa6, 0x8a, 0xa8, 0x2f, 0xf6, 0x28, 0x8f, 0x19, 0x3d, 0x1c, 0xc5, 0xd8, 0xdb, - 0x4c, 0x93, 0x65, 0x53, 0x86, 0x59, 0x36, 0x1c, 0x1e, 0x1e, 0x56, 0xa4, 0xe4, 0xc1, 0xff, 0x02, - 0x00, 0x00, 0xff, 0xff, 0xc1, 0x89, 0xef, 0x28, 0xb0, 0x1f, 0x00, 0x00, + // 1837 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0x23, 0x49, + 0x15, 0xdf, 0xee, 0xf6, 0x47, 0xfc, 0xec, 0x38, 0x3d, 0x95, 0x64, 0xc6, 0xb3, 0xb3, 0xec, 0x64, + 0x7a, 0x10, 0x1b, 0x16, 0x91, 0x40, 0x86, 0x03, 0x7b, 0x83, 0xc4, 0x5a, 0xd6, 0x0c, 0x19, 0x85, + 0x4e, 0xb4, 0x48, 0x68, 0xa5, 0x56, 0xc7, 0x7e, 0xb1, 0x4b, 0xfd, 0xe5, 0x54, 0xb5, 0x27, 0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 0xfc, 0x89, 0xfa, 0x49, 0x55, 0xf7, 0xe6, 0x47, 0x86, 0x14, 0x7f, 0xb2, 0xd6, 0x37, + 0xff, 0x6d, 0x90, 0x26, 0xd4, 0xbc, 0xb4, 0x9e, 0x35, 0x7f, 0x5d, 0x93, 0x52, 0x17, 0x9f, 0x0a, + 0xf3, 0x83, 0x1a, 0x59, 0x02, 0xf0, 0xb2, 0xb2, 0xc7, 0xfc, 0x4d, 0xed, 0xcd, 0xb7, 0x60, 0x21, + 0xfd, 0x7b, 0x90, 0x00, 0x54, 0x76, 0x5d, 0x1e, 0x23, 0x33, 0x5f, 0x11, 0x6b, 0x1b, 0xdd, 0x1e, + 0x32, 0x53, 0x13, 0xeb, 0xef, 0x30, 0x2a, 0xf8, 0xba, 0xb0, 0xf9, 0x9e, 0x70, 0x4c, 0xd3, 0xd8, + 0x6e, 0x7f, 0x77, 0xbb, 0x4f, 0xe3, 0xc1, 0xe8, 0x50, 0x78, 0xcd, 0xe6, 0x13, 0xea, 0xfb, 0xf4, + 0x49, 0x8c, 0xdd, 0xc1, 0xa6, 0xf2, 0xa8, 0x2f, 0xf6, 0x28, 0x8f, 0x19, 0x3d, 0x1c, 0xc5, 0xd8, + 0xdb, 0x4c, 0x83, 0x65, 0x53, 0xba, 0x59, 0x46, 0x0e, 0x0f, 0x0f, 0x2b, 0x92, 0xf3, 0xe0, 0xbf, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xdd, 0xfb, 0x16, 0x8f, 0x1f, 0x00, 0x00, } diff --git a/internal/proxy/task.go b/internal/proxy/task.go index 425cae75cfb3e4de24b55cf4a24cf3cc5aa55dbe..5208355f6e39feb7ba8c10c4dc00ff97fc4dcd39 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -487,7 +487,6 @@ func (qt *QueryTask) PostExecute() error { Hits: make([][]byte, 0), } - const minFloat32 = -1 * float32(math.MaxFloat32) for i := 0; i < nq; i++ { locs := make([]int, availableQueryNodeNum) reducedHits := &servicepb.Hits{ @@ -497,18 +496,18 @@ func (qt *QueryTask) PostExecute() error { } for j := 0; j < topk; j++ { - choice, maxDistance := 0, minFloat32 + choice, minDistance := 0, float32(math.MaxFloat32) for q, loc := range locs { // query num, the number of ways to merge distance := hits[q][i].Scores[loc] - if distance > maxDistance { + if distance < minDistance { choice = q - maxDistance = distance + minDistance = distance } } choiceOffset := locs[choice] // check if distance is valid, `invalid` here means very very big, // in this process, distance here is the smallest, so the rest of distance are all invalid - if hits[choice][i].Scores[choiceOffset] <= minFloat32 { + if hits[choice][i].Scores[choiceOffset] >= float32(math.MaxFloat32) { break } reducedHits.IDs = append(reducedHits.IDs, hits[choice][i].IDs[choiceOffset]) @@ -518,11 +517,6 @@ func (qt *QueryTask) PostExecute() error { reducedHits.Scores = append(reducedHits.Scores, hits[choice][i].Scores[choiceOffset]) locs[choice]++ } - if searchResults[0].MetricType != "IP" { - for k := range reducedHits.Scores { - reducedHits.Scores[k] *= -1 - } - } reducedHitsBs, err := proto.Marshal(reducedHits) if err != nil { log.Println("marshal error") diff --git a/internal/querynode/plan.go b/internal/querynode/plan.go index 0909406189a66b1ce2c74865bc2bbb25237f9463..48de96cd21e1aff7478a36d4f5c5d4f74eec2fc1 100644 --- a/internal/querynode/plan.go +++ b/internal/querynode/plan.go @@ -41,13 +41,6 @@ func (plan *Plan) getTopK() int64 { return int64(topK) } -func (plan *Plan) getMetricType() string { - cMetricType := C.GetMetricType(plan.cPlan) - defer C.free(unsafe.Pointer(cMetricType)) - metricType := C.GoString(cMetricType) - return metricType -} - func (plan *Plan) delete() { C.DeletePlan(plan.cPlan) } diff --git a/internal/querynode/plan_test.go b/internal/querynode/plan_test.go index 5609a0cad6fbdb169636218ab1104bb70e109edc..506acde6c10af181de5d2b33c734dda592b34d07 100644 --- a/internal/querynode/plan_test.go +++ b/internal/querynode/plan_test.go @@ -27,8 +27,6 @@ func TestPlan_Plan(t *testing.T) { assert.NotEqual(t, plan, nil) topk := plan.getTopK() assert.Equal(t, int(topk), 10) - metricType := plan.getMetricType() - assert.Equal(t, metricType, "L2") plan.delete() deleteCollection(collection) } diff --git a/internal/querynode/search_service.go b/internal/querynode/search_service.go index c2e0fa5d93b37f8d11be301dcc165fe523fe37ff..4503449189b6ab698e4670692d43d1e5e15f006c 100644 --- a/internal/querynode/search_service.go +++ b/internal/querynode/search_service.go @@ -336,7 +336,6 @@ func (ss *searchService) search(msg msgstream.TsMsg) error { Timestamp: searchTimestamp, ResultChannelID: searchMsg.ResultChannelID, Hits: hits, - MetricType: plan.getMetricType(), } searchResultMsg := &msgstream.SearchResultMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{uint32(searchMsg.ResultChannelID)}}, diff --git a/internal/writenode/data_sync_service.go b/internal/writenode/data_sync_service.go index 3c18b4eaa3e319fa786001d60d7406a98670f58d..da91d06a7640a0175963bc05443257cb591cc662 100644 --- a/internal/writenode/data_sync_service.go +++ b/internal/writenode/data_sync_service.go @@ -8,15 +8,20 @@ import ( ) type dataSyncService struct { - ctx context.Context - fg *flowgraph.TimeTickedFlowGraph + ctx context.Context + fg *flowgraph.TimeTickedFlowGraph + ddChan chan *ddlFlushSyncMsg + insertChan chan *insertFlushSyncMsg } -func newDataSyncService(ctx context.Context) *dataSyncService { +func newDataSyncService(ctx context.Context, + ddChan chan *ddlFlushSyncMsg, insertChan chan *insertFlushSyncMsg) *dataSyncService { return &dataSyncService{ - ctx: ctx, - fg: nil, + ctx: ctx, + fg: nil, + ddChan: ddChan, + insertChan: insertChan, } } @@ -39,9 +44,10 @@ func (dsService *dataSyncService) initNodes() { var dmStreamNode Node = newDmInputNode(dsService.ctx) var ddStreamNode Node = newDDInputNode(dsService.ctx) - var ddNode Node = newDDNode(dsService.ctx) var filterDmNode Node = newFilteredDmNode() - var insertBufferNode Node = newInsertBufferNode(dsService.ctx) + + var ddNode Node = newDDNode(dsService.ctx, dsService.ddChan) + var insertBufferNode Node = newInsertBufferNode(dsService.ctx, dsService.insertChan) dsService.fg.AddNode(&dmStreamNode) dsService.fg.AddNode(&ddStreamNode) diff --git a/internal/writenode/data_sync_service_test.go b/internal/writenode/data_sync_service_test.go index 92d9e29c09a2718f235ab17fd520db5356b77724..7a789df98258b7ff062d102c7dd68e3a46b71e57 100644 --- a/internal/writenode/data_sync_service_test.go +++ b/internal/writenode/data_sync_service_test.go @@ -39,8 +39,7 @@ func TestDataSyncService_Start(t *testing.T) { // init write node pulsarURL := Params.PulsarAddress - node, err := NewWriteNode(ctx, 0) - assert.Nil(t, err) + node := NewWriteNode(ctx, 0) // test data generate // GOOSE TODO orgnize @@ -190,7 +189,7 @@ func TestDataSyncService_Start(t *testing.T) { var ddMsgStream msgstream.MsgStream = ddStream ddMsgStream.Start() - err = insertMsgStream.Produce(&msgPack) + err := insertMsgStream.Produce(&msgPack) assert.NoError(t, err) err = insertMsgStream.Broadcast(&timeTickMsgPack) @@ -199,7 +198,7 @@ func TestDataSyncService_Start(t *testing.T) { assert.NoError(t, err) // dataSync - node.dataSyncService = newDataSyncService(node.ctx) + node.dataSyncService = newDataSyncService(node.ctx, nil, nil) go node.dataSyncService.start() node.Close() diff --git a/internal/writenode/flow_graph_dd_node.go b/internal/writenode/flow_graph_dd_node.go index f9b8a3946355df921ea1b4ac884d49c4877f6e73..89c0bd61a118366a656347eeebb09ccad13e8ac3 100644 --- a/internal/writenode/flow_graph_dd_node.go +++ b/internal/writenode/flow_graph_dd_node.go @@ -25,6 +25,7 @@ type ddNode struct { ddMsg *ddMsg ddRecords *ddRecords ddBuffer *ddBuffer + outCh chan *ddlFlushSyncMsg // for flush sync idAllocator *allocator.IDAllocator kv kv.Base @@ -311,7 +312,7 @@ func (ddNode *ddNode) dropPartition(msg *msgstream.DropPartitionMsg) { ddNode.ddBuffer.ddData[collectionID].eventTypes = append(ddNode.ddBuffer.ddData[collectionID].eventTypes, storage.DropPartitionEventType) } -func newDDNode(ctx context.Context) *ddNode { +func newDDNode(ctx context.Context, outCh chan *ddlFlushSyncMsg) *ddNode { maxQueueLength := Params.FlowGraphMaxQueueLength maxParallelism := Params.FlowGraphMaxParallelism @@ -335,8 +336,8 @@ func newDDNode(ctx context.Context) *ddNode { if err != nil { panic(err) } - // TODO: load bucket name from yaml? - minioKV, err := miniokv.NewMinIOKV(ctx, minIOClient, "write-node-dd-node") + bucketName := Params.MinioBucketName + minioKV, err := miniokv.NewMinIOKV(ctx, minIOClient, bucketName) if err != nil { panic(err) } @@ -357,6 +358,7 @@ func newDDNode(ctx context.Context) *ddNode { ddData: make(map[UniqueID]*ddData), maxSize: Params.FlushDdBufSize, }, + outCh: outCh, idAllocator: idAllocator, kv: minioKV, diff --git a/internal/writenode/flow_graph_dd_node_test.go b/internal/writenode/flow_graph_dd_node_test.go index 5903a47b9fdeee37e41b9210ae8d09247b155b3d..2e5fabeb597dae44790cae95c12d2ee486d1ce7c 100644 --- a/internal/writenode/flow_graph_dd_node_test.go +++ b/internal/writenode/flow_graph_dd_node_test.go @@ -26,10 +26,9 @@ func TestFlowGraphDDNode_Operate(t *testing.T) { ctx = context.Background() } - startMaster(ctx) Params.FlushDdBufSize = 4 - ddNode := newDDNode(ctx) + ddNode := newDDNode(ctx, nil) colID := UniqueID(0) colName := "col-test-0" diff --git a/internal/writenode/flow_graph_insert_buffer_node.go b/internal/writenode/flow_graph_insert_buffer_node.go index 91fdca6ccb8d0d822915161d74f6ae9dde3548bf..e1753884a5732ab1162446b3b87f29a33c75af94 100644 --- a/internal/writenode/flow_graph_insert_buffer_node.go +++ b/internal/writenode/flow_graph_insert_buffer_node.go @@ -39,6 +39,7 @@ type ( minIOKV kv.Base minioPrifex string idAllocator *allocator.IDAllocator + outCh chan *insertFlushSyncMsg } insertBuffer struct { @@ -428,7 +429,7 @@ func (ibNode *insertBufferNode) Operate(in []*Msg) []*Msg { return nil } -func newInsertBufferNode(ctx context.Context) *insertBufferNode { +func newInsertBufferNode(ctx context.Context, outCh chan *insertFlushSyncMsg) *insertBufferNode { maxQueueLength := Params.FlowGraphMaxQueueLength maxParallelism := Params.FlowGraphMaxParallelism @@ -447,10 +448,13 @@ func newInsertBufferNode(ctx context.Context) *insertBufferNode { ETCDAddr := Params.EtcdAddress MetaRootPath := Params.MetaRootPath log.Println("metaRootPath: ", MetaRootPath) - cli, _ := clientv3.New(clientv3.Config{ + cli, err := clientv3.New(clientv3.Config{ Endpoints: []string{ETCDAddr}, DialTimeout: 5 * time.Second, }) + if err != nil { + panic(err) + } kvClient := etcdkv.NewEtcdKV(cli, MetaRootPath) // MinIO @@ -460,14 +464,23 @@ func newInsertBufferNode(ctx context.Context) *insertBufferNode { minioUseSSL := Params.MinioUseSSL minioBucketName := Params.MinioBucketName - minioClient, _ := minio.New(minioendPoint, &minio.Options{ + minioClient, err := minio.New(minioendPoint, &minio.Options{ Creds: credentials.NewStaticV4(miniioAccessKeyID, miniioSecretAccessKey, ""), Secure: minioUseSSL, }) - minIOKV, _ := miniokv.NewMinIOKV(ctx, minioClient, minioBucketName) + if err != nil { + panic(err) + } + minIOKV, err := miniokv.NewMinIOKV(ctx, minioClient, minioBucketName) + if err != nil { + panic(err) + } minioPrefix := Params.InsertLogRootPath - idAllocator, _ := allocator.NewIDAllocator(ctx, Params.MasterAddress) + idAllocator, err := allocator.NewIDAllocator(ctx, Params.MasterAddress) + if err != nil { + panic(err) + } return &insertBufferNode{ BaseNode: baseNode, @@ -476,5 +489,6 @@ func newInsertBufferNode(ctx context.Context) *insertBufferNode { minIOKV: minIOKV, minioPrifex: minioPrefix, idAllocator: idAllocator, + outCh: outCh, } } diff --git a/internal/writenode/flush_msg.go b/internal/writenode/flush_msg.go new file mode 100644 index 0000000000000000000000000000000000000000..935c39fd42cc7004634d75a2601d721bf3dff8f3 --- /dev/null +++ b/internal/writenode/flush_msg.go @@ -0,0 +1,39 @@ +package writenode + +type ( + // segID: set when flushComplete == true, to tell + // the flush_sync_service which segFlush msg does this + // DDL flush for, so that ddl flush and insert flush + // will sync. + ddlBinlogPathMsg struct { + collID UniqueID + segID UniqueID + paths []string + } + + ddlFlushSyncMsg struct { + ddlBinlogPathMsg + flushCompleted bool + } + + insertBinlogPathMsg struct { + ts Timestamp + segID UniqueID + fieldID int32 // TODO GOOSE may need to change + paths []string + } + + // This Msg can notify flushSyncService + // 1.To append binary logs + // 2.To set flush-completed status + // + // When `flushComplete == false` + // `ts` means OpenTime of a segFlushMeta + // When `flushComplete == true` + // `ts` means CloseTime of a segFlushMeta, + // `fieldID` and `paths` need to be empty + insertFlushSyncMsg struct { + insertBinlogPathMsg + flushCompleted bool + } +) diff --git a/internal/writenode/flush_sync_service.go b/internal/writenode/flush_sync_service.go new file mode 100644 index 0000000000000000000000000000000000000000..f90db89ccd655b94843111deda384a376c02732b --- /dev/null +++ b/internal/writenode/flush_sync_service.go @@ -0,0 +1,119 @@ +package writenode + +import ( + "context" + "log" + + etcdkv "github.com/zilliztech/milvus-distributed/internal/kv/etcd" + "go.etcd.io/etcd/clientv3" +) + +type ( + flushSyncService struct { + ctx context.Context + metaTable *metaTable + ddChan chan *ddlFlushSyncMsg // TODO GOOSE Init Size?? + insertChan chan *insertFlushSyncMsg // TODO GOOSE Init Size?? + ddFlushed map[UniqueID]bool // Segment ID + insertFlushed map[UniqueID]bool // Segment ID + } +) + +func newFlushSyncService(ctx context.Context, + ddChan chan *ddlFlushSyncMsg, insertChan chan *insertFlushSyncMsg) *flushSyncService { + + service := &flushSyncService{ + ctx: ctx, + ddChan: ddChan, + insertChan: insertChan, + ddFlushed: make(map[UniqueID]bool), + insertFlushed: make(map[UniqueID]bool), + } + + // New metaTable + etcdAddr := Params.EtcdAddress + etcdClient, err := clientv3.New(clientv3.Config{Endpoints: []string{etcdAddr}}) + if err != nil { + panic(err) + } + etcdKV := etcdkv.NewEtcdKV(etcdClient, Params.MetaRootPath) + metaKV, err2 := NewMetaTable(etcdKV) + if err2 != nil { + panic(err2) + } + + service.metaTable = metaKV + return service +} + +func (fService *flushSyncService) completeDDFlush(segID UniqueID) { + if _, ok := fService.ddFlushed[segID]; !ok { + fService.ddFlushed[segID] = true + return + } + + fService.ddFlushed[segID] = true +} + +func (fService *flushSyncService) completeInsertFlush(segID UniqueID) { + if _, ok := fService.insertFlushed[segID]; !ok { + fService.insertFlushed[segID] = true + return + } + fService.insertFlushed[segID] = true +} + +func (fService *flushSyncService) FlushCompleted(segID UniqueID) bool { + isddFlushed, ok := fService.ddFlushed[segID] + if !ok { + return false + } + + isinsertFlushed, ok := fService.insertFlushed[segID] + if !ok { + return false + } + return isddFlushed && isinsertFlushed +} + +func (fService *flushSyncService) start() { + for { + select { + case <-fService.ctx.Done(): + return + + case ddFlushMsg := <-fService.ddChan: + if ddFlushMsg == nil { + continue + } + if !ddFlushMsg.flushCompleted { + err := fService.metaTable.AppendDDLBinlogPaths(ddFlushMsg.collID, ddFlushMsg.paths) + if err != nil { + log.Println("Append segBinlog Error") + // GOOSE TODO error handling + } + continue + } + fService.completeDDFlush(ddFlushMsg.segID) + + case insertFlushMsg := <-fService.insertChan: + if insertFlushMsg == nil { + continue + } + if !insertFlushMsg.flushCompleted { + err := fService.metaTable.AppendSegBinlogPaths(insertFlushMsg.ts, insertFlushMsg.segID, insertFlushMsg.fieldID, + insertFlushMsg.paths) + if err != nil { + log.Println("Append segBinlog Error") + // GOOSE TODO error handling + } + continue + } + fService.completeInsertFlush(insertFlushMsg.segID) + + if fService.FlushCompleted(insertFlushMsg.segID) { + fService.metaTable.CompleteFlush(insertFlushMsg.ts, insertFlushMsg.segID) + } + } + } +} diff --git a/internal/writenode/flush_sync_service_test.go b/internal/writenode/flush_sync_service_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f279fc21abb9e6e26d4aac90648801b9b0ae7d0b --- /dev/null +++ b/internal/writenode/flush_sync_service_test.go @@ -0,0 +1,164 @@ +package writenode + +import ( + "context" + "log" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.etcd.io/etcd/clientv3" + + etcdkv "github.com/zilliztech/milvus-distributed/internal/kv/etcd" +) + +func clearEtcd(rootPath string) error { + etcdAddr := Params.EtcdAddress + etcdClient, err := clientv3.New(clientv3.Config{Endpoints: []string{etcdAddr}}) + if err != nil { + return err + } + etcdKV := etcdkv.NewEtcdKV(etcdClient, rootPath) + + err = etcdKV.RemoveWithPrefix("writer/segment") + if err != nil { + return err + } + _, _, err = etcdKV.LoadWithPrefix("writer/segment") + if err != nil { + return err + } + log.Println("Clear ETCD with prefix writer/segment ") + + err = etcdKV.RemoveWithPrefix("writer/ddl") + if err != nil { + return err + } + _, _, err = etcdKV.LoadWithPrefix("writer/ddl") + if err != nil { + return err + } + log.Println("Clear ETCD with prefix writer/ddl") + return nil + +} + +func TestFlushSyncService_Start(t *testing.T) { + const ctxTimeInMillisecond = 3000 + const closeWithDeadline = false + var ctx context.Context + var cancel context.CancelFunc + + if closeWithDeadline { + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, cancel = context.WithDeadline(context.Background(), d) + defer cancel() + } else { + // ctx = context.Background() + ctx, cancel = context.WithCancel(context.Background()) + defer cancel() + } + + ddChan := make(chan *ddlFlushSyncMsg, 10) + defer close(ddChan) + insertChan := make(chan *insertFlushSyncMsg, 10) + defer close(insertChan) + + testPath := "/test/writenode/root/meta" + err := clearEtcd(testPath) + require.NoError(t, err) + Params.MetaRootPath = testPath + fService := newFlushSyncService(ctx, ddChan, insertChan) + assert.Equal(t, testPath, fService.metaTable.client.(*etcdkv.EtcdKV).GetPath(".")) + + t.Run("FlushSyncService", func(t *testing.T) { + go fService.start() + + SegID := UniqueID(100) + ddMsgs := genDdlFlushSyncMsgs(SegID) + insertMsgs := geninsertFlushSyncMsgs(SegID) + + for _, msg := range ddMsgs { + ddChan <- msg + time.Sleep(time.Millisecond * 10) + } + + for _, msg := range insertMsgs { + insertChan <- msg + time.Sleep(time.Millisecond * 10) + } + + ret, err := fService.metaTable.getSegBinlogPaths(SegID) + assert.NoError(t, err) + assert.Equal(t, map[int32][]string{ + 0: {"x", "y", "z"}, + 1: {"x", "y", "z"}, + 2: {"x", "y", "z"}, + 3: {"x", "y", "z"}, + 4: {"x", "y", "z"}, + }, ret) + + ts, err := fService.metaTable.getFlushOpenTime(SegID) + assert.NoError(t, err) + assert.Equal(t, Timestamp(1000), ts) + + ts, err = fService.metaTable.getFlushCloseTime(SegID) + assert.NoError(t, err) + assert.Equal(t, Timestamp(2010), ts) + + cp, err := fService.metaTable.checkFlushComplete(SegID) + assert.NoError(t, err) + assert.Equal(t, true, cp) + + cp, err = fService.metaTable.checkFlushComplete(SegID) + assert.NoError(t, err) + assert.Equal(t, true, cp) + + }) +} + +func genDdlFlushSyncMsgs(segID UniqueID) []*ddlFlushSyncMsg { + ret := make([]*ddlFlushSyncMsg, 0) + for i := 0; i < 5; i++ { + ret = append(ret, &ddlFlushSyncMsg{ + flushCompleted: false, + ddlBinlogPathMsg: ddlBinlogPathMsg{ + collID: UniqueID(100), + paths: []string{"a", "b", "c"}, + }, + }) + } + + ret = append(ret, &ddlFlushSyncMsg{ + flushCompleted: true, + ddlBinlogPathMsg: ddlBinlogPathMsg{ + segID: segID, + }, + }) + return ret +} + +func geninsertFlushSyncMsgs(segID UniqueID) []*insertFlushSyncMsg { + ret := make([]*insertFlushSyncMsg, 0) + for i := 0; i < 5; i++ { + ret = append(ret, &insertFlushSyncMsg{ + flushCompleted: false, + insertBinlogPathMsg: insertBinlogPathMsg{ + ts: Timestamp(1000 + i), + segID: segID, + fieldID: int32(i), + paths: []string{"x", "y", "z"}, + }, + }) + } + + ret = append(ret, &insertFlushSyncMsg{ + flushCompleted: true, + insertBinlogPathMsg: insertBinlogPathMsg{ + ts: Timestamp(2010), + segID: segID, + }, + }) + return ret +} diff --git a/internal/writenode/meta_table.go b/internal/writenode/meta_table.go index 698da07dd8fc203ba2c3df3d36000be156aae497..aab9915856af65e39ac74b10cb8f591d54f3bdc5 100644 --- a/internal/writenode/meta_table.go +++ b/internal/writenode/meta_table.go @@ -55,13 +55,11 @@ func (mt *metaTable) AppendDDLBinlogPaths(collID UniqueID, paths []string) error return mt.saveDDLFlushMeta(meta) } -func (mt *metaTable) AppendSegBinlogPaths(timestamp Timestamp, segmentID UniqueID, fieldID int32, dataPaths []string) error { - mt.lock.Lock() - defer mt.lock.Unlock() +func (mt *metaTable) AppendSegBinlogPaths(tsOpen Timestamp, segmentID UniqueID, fieldID int32, dataPaths []string) error { _, ok := mt.segID2FlushMeta[segmentID] if !ok { - err := mt.addSegmentFlush(segmentID, timestamp) + err := mt.addSegmentFlush(segmentID, tsOpen) if err != nil { return err } @@ -89,6 +87,19 @@ func (mt *metaTable) AppendSegBinlogPaths(timestamp Timestamp, segmentID UniqueI return mt.saveSegFlushMeta(&meta) } +func (mt *metaTable) CompleteFlush(tsClose Timestamp, segmentID UniqueID) error { + mt.lock.Lock() + defer mt.lock.Unlock() + meta, ok := mt.segID2FlushMeta[segmentID] + if !ok { + return errors.Errorf("segment not exists with ID = " + strconv.FormatInt(segmentID, 10)) + } + meta.IsClosed = true + meta.CloseTime = tsClose + + return mt.saveSegFlushMeta(&meta) +} + // metaTable.lock.Lock() before call this function func (mt *metaTable) saveDDLFlushMeta(meta *pb.DDLFlushMeta) error { value := proto.MarshalTextString(meta) @@ -180,19 +191,6 @@ func (mt *metaTable) getFlushOpenTime(segmentID UniqueID) (Timestamp, error) { return meta.OpenTime, nil } -func (mt *metaTable) CompleteFlush(segmentID UniqueID, timestamp Timestamp) error { - mt.lock.Lock() - defer mt.lock.Unlock() - meta, ok := mt.segID2FlushMeta[segmentID] - if !ok { - return errors.Errorf("segment not exists with ID = " + strconv.FormatInt(segmentID, 10)) - } - meta.IsClosed = true - meta.CloseTime = timestamp - - return mt.saveSegFlushMeta(&meta) -} - func (mt *metaTable) checkFlushComplete(segmentID UniqueID) (bool, error) { mt.lock.Lock() defer mt.lock.Unlock() diff --git a/internal/writenode/meta_table_test.go b/internal/writenode/meta_table_test.go index 8bafa7fbc6b5edb8962c094de2f6d2ff95004c9e..b02604a82b1140cdbdb01dc774fc54ce82411880 100644 --- a/internal/writenode/meta_table_test.go +++ b/internal/writenode/meta_table_test.go @@ -112,7 +112,7 @@ func TestMetaTable_all(t *testing.T) { assert.NoError(t, err) assert.Equal(t, false, ret) - meta.CompleteFlush(segmentID, closeTime) + meta.CompleteFlush(closeTime, segmentID) ret, err = meta.checkFlushComplete(segmentID) assert.NoError(t, err) diff --git a/internal/writenode/param_table_test.go b/internal/writenode/param_table_test.go index ed9405ccb6a1909b55d5a3dab3fddfdc7fb22ace..10367b596b5c4b9d5fe471fc6d8e15f74913ad58 100644 --- a/internal/writenode/param_table_test.go +++ b/internal/writenode/param_table_test.go @@ -84,7 +84,7 @@ func TestParamTable_WriteNode(t *testing.T) { t.Run("Test MinioBucketName", func(t *testing.T) { name := Params.MinioBucketName - assert.Equal(t, name, "A-bucket") + assert.Equal(t, name, "a-bucket") }) t.Run("Test FlushInsertBufSize", func(t *testing.T) { diff --git a/internal/writenode/write_node.go b/internal/writenode/write_node.go index b5c26186095a7390bbd462834efe177515b27b82..137f033c74d2beaad5f5c9ac726f68e7521bea4e 100644 --- a/internal/writenode/write_node.go +++ b/internal/writenode/write_node.go @@ -2,48 +2,37 @@ package writenode import ( "context" - - etcdkv "github.com/zilliztech/milvus-distributed/internal/kv/etcd" - "go.etcd.io/etcd/clientv3" ) type WriteNode struct { - ctx context.Context - WriteNodeID uint64 - dataSyncService *dataSyncService - - metaTable *metaTable + ctx context.Context + WriteNodeID uint64 + dataSyncService *dataSyncService + flushSyncService *flushSyncService } -func NewWriteNode(ctx context.Context, writeNodeID uint64) (*WriteNode, error) { +func NewWriteNode(ctx context.Context, writeNodeID uint64) *WriteNode { node := &WriteNode{ - ctx: ctx, - WriteNodeID: writeNodeID, - dataSyncService: nil, + ctx: ctx, + WriteNodeID: writeNodeID, + dataSyncService: nil, + flushSyncService: nil, } - etcdAddress := Params.EtcdAddress - etcdClient, err := clientv3.New(clientv3.Config{Endpoints: []string{etcdAddress}}) - if err != nil { - return nil, err - } - etcdKV := etcdkv.NewEtcdKV(etcdClient, Params.MetaRootPath) - metaKV, err2 := NewMetaTable(etcdKV) - if err2 != nil { - return nil, err - } - node.metaTable = metaKV - - return node, nil + return node } func (node *WriteNode) Start() { - node.dataSyncService = newDataSyncService(node.ctx) - // node.statsService = newStatsService(node.ctx) + + ddChan := make(chan *ddlFlushSyncMsg, 5) + insertChan := make(chan *insertFlushSyncMsg, 5) + node.flushSyncService = newFlushSyncService(node.ctx, ddChan, insertChan) + + node.dataSyncService = newDataSyncService(node.ctx, ddChan, insertChan) go node.dataSyncService.start() - // node.statsService.start() + go node.flushSyncService.start() } func (node *WriteNode) Close() { @@ -53,7 +42,4 @@ func (node *WriteNode) Close() { if node.dataSyncService != nil { (*node.dataSyncService).close() } - // if node.statsService != nil { - // (*node.statsService).close() - // } } diff --git a/internal/writenode/write_node_test.go b/internal/writenode/write_node_test.go index b99288b3cd5a40cdfff58a0bca0676886bad90e4..0cd3342d147dbd4054342aae4a3c84d79fa9f943 100644 --- a/internal/writenode/write_node_test.go +++ b/internal/writenode/write_node_test.go @@ -8,6 +8,7 @@ import ( "os" "strconv" "testing" + "time" "go.etcd.io/etcd/clientv3" "go.uber.org/zap" @@ -60,6 +61,20 @@ func startMaster(ctx context.Context) { func TestMain(m *testing.M) { Params.Init() refreshChannelNames() + const ctxTimeInMillisecond = 2000 + const closeWithDeadline = true + var ctx context.Context + + if closeWithDeadline { + var cancel context.CancelFunc + d := time.Now().Add(ctxTimeInMillisecond * time.Millisecond) + ctx, cancel = context.WithDeadline(context.Background(), d) + defer cancel() + } else { + ctx = context.Background() + } + + startMaster(ctx) p := Params fmt.Println(p) exitCode := m.Run()