diff --git a/.github/mergify.yml b/.github/mergify.yml index 9b67142e47b39..6865b740e712f 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,7 +50,7 @@ pull_request_rules: - 'status-success=UT for Cpp' - 'status-success=UT for Go' - 'status-success=Integration Test' - # - 'status-success=Code Checker AMD64 Ubuntu 22.04' + - 'status-success=Code Checker AMD64 Ubuntu 22.04' # - 'status-success=Code Checker MacOS 12' # - 'status-success=Code Checker Amazonlinux 2023' - 'status-success=cpu-e2e' @@ -63,7 +63,7 @@ pull_request_rules: - name: Test passed for code changed -2.*.* conditions: - base~=^2(\.\d+){2}$ - # - 'status-success=Code Checker AMD64 Ubuntu 22.04' + - 'status-success=Code Checker AMD64 Ubuntu 22.04' - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22 - 'status-success=UT for Cpp' - 'status-success=UT for Go' @@ -123,7 +123,7 @@ pull_request_rules: - base=sql_beta - base~=^2(\.\d+){1,2}$ - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22 - # - 'status-success=Code Checker AMD64 Ubuntu 22.04' + - 'status-success=Code Checker AMD64 Ubuntu 22.04' # - 'status-success=Code Checker MacOS 12' # - 'status-success=Code Checker Amazonlinux 2023' - 'status-success=UT for Go' @@ -139,7 +139,7 @@ pull_request_rules: conditions: - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22 - base~=^2\.2\.\d+$ - # - 'status-success=Code Checker AMD64 Ubuntu 22.04' + - 'status-success=Code Checker AMD64 Ubuntu 22.04' # - 'status-success=Code Checker MacOS 12' - -files~=^(?!internal\/.*_test\.go).*$ actions: @@ -267,7 +267,7 @@ pull_request_rules: - base~=^2(\.\d+){1,2}$ - or: *Build_AND_TEST_STATUS_SUCESS_ON_UBUNTU_20_OR_UBUNTU_22 - title~=\[skip e2e\] - # - 'status-success=Code Checker AMD64 Ubuntu 22.04' + - 'status-success=Code Checker AMD64 Ubuntu 22.04' - 'status-success=UT for Cpp' - 'status-success=UT for Go' - 'status-success=Integration Test' @@ -320,7 +320,7 @@ pull_request_rules: - or: - *failed_on_ubuntu_20 - *failed_on_ubuntu_22 - # - 'status-success!=Code Checker AMD64 Ubuntu 22.04' + - 'status-success!=Code Checker AMD64 Ubuntu 22.04' - 'status-success!=UT for Cpp' - 'status-success!=UT for Go' - 'status-success!=Integration Test' diff --git a/.github/workflows/code-checker.yaml b/.github/workflows/code-checker.yaml index 0f49d40b93cfb..bed6ca967e6c0 100644 --- a/.github/workflows/code-checker.yaml +++ b/.github/workflows/code-checker.yaml @@ -61,54 +61,54 @@ jobs: run: | ./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers" - amazonlinux: - name: Code Checker Amazonlinux 2023 - # Run in amazonlinux docker - runs-on: ubuntu-latest - timeout-minutes: 180 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'amazonlinux2023' - - name: Code Check - run: | - sed -i 's/ubuntu22.04/amazonlinux2023/g' .env - ./build/builder.sh /bin/bash -c "make install" + # amazonlinux: + # name: Code Checker Amazonlinux 2023 + # # Run in amazonlinux docker + # runs-on: ubuntu-latest + # timeout-minutes: 180 + # steps: + # - name: Maximize build space + # uses: easimon/maximize-build-space@master + # if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner + # with: + # root-reserve-mb: 20480 + # swap-size-mb: 1024 + # remove-dotnet: 'true' + # remove-android: 'true' + # remove-haskell: 'true' + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Download Caches + # uses: ./.github/actions/cache + # with: + # os: 'amazonlinux2023' + # - name: Code Check + # run: | + # sed -i 's/ubuntu22.04/amazonlinux2023/g' .env + # ./build/builder.sh /bin/bash -c "make install" - rockylinux: - name: Code Checker rockylinux8 - # Run in amazonlinux docker - runs-on: ubuntu-latest - timeout-minutes: 180 - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner - with: - root-reserve-mb: 20480 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - - name: Checkout - uses: actions/checkout@v2 - - name: Download Caches - uses: ./.github/actions/cache - with: - os: 'rockylinux8' - - name: Code Check - run: | - sed -i 's/ubuntu22.04/rockylinux8/g' .env - ./build/builder.sh /bin/bash -c "make install" + # rockylinux: + # name: Code Checker rockylinux8 + # # Run in amazonlinux docker + # runs-on: ubuntu-latest + # timeout-minutes: 180 + # steps: + # - name: Maximize build space + # uses: easimon/maximize-build-space@master + # if: ${{ ! startsWith(runner.name, 'self') }} # skip this step if it is self-hosted runner + # with: + # root-reserve-mb: 20480 + # swap-size-mb: 1024 + # remove-dotnet: 'true' + # remove-android: 'true' + # remove-haskell: 'true' + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Download Caches + # uses: ./.github/actions/cache + # with: + # os: 'rockylinux8' + # - name: Code Check + # run: | + # sed -i 's/ubuntu22.04/rockylinux8/g' .env + # ./build/builder.sh /bin/bash -c "make install" diff --git a/Makefile b/Makefile index 8a738964ea41d..48441d5dba6b0 100644 --- a/Makefile +++ b/Makefile @@ -182,13 +182,13 @@ lint-fix: getdeps static-check: getdeps @echo "Running $@ check" @echo "Start check core packages" - @source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --build-tags dynamic,test --timeout=30m --config $(PWD)/.golangci.yml + @source $(PWD)/scripts/setenv.sh && GO111MODULE=on GOFLAGS=-buildvcs=false $(INSTALL_PATH)/golangci-lint run --build-tags dynamic,test --timeout=30m --config $(PWD)/.golangci.yml @echo "Start check pkg package" - @source $(PWD)/scripts/setenv.sh && cd pkg && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --build-tags dynamic,test --timeout=30m --config $(PWD)/.golangci.yml + @source $(PWD)/scripts/setenv.sh && cd pkg && GO111MODULE=on GOFLAGS=-buildvcs=false $(INSTALL_PATH)/golangci-lint run --build-tags dynamic,test --timeout=30m --config $(PWD)/.golangci.yml @echo "Start check client package" - @source $(PWD)/scripts/setenv.sh && cd client && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config $(PWD)/client/.golangci.yml + @source $(PWD)/scripts/setenv.sh && cd client && GO111MODULE=on GOFLAGS=-buildvcs=false $(INSTALL_PATH)/golangci-lint run --timeout=30m --config $(PWD)/client/.golangci.yml @echo "Start check go_client e2e package" - @source $(PWD)/scripts/setenv.sh && cd tests/go_client && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config $(PWD)/client/.golangci.yml + @source $(PWD)/scripts/setenv.sh && cd tests/go_client && GO111MODULE=on GOFLAGS=-buildvcs=false $(INSTALL_PATH)/golangci-lint run --timeout=30m --config $(PWD)/client/.golangci.yml verifiers: build-cpp getdeps cppcheck fmt static-check diff --git a/cmd/milvus/mck.go b/cmd/milvus/mck.go index b8534eb09c77b..6581356c252b6 100644 --- a/cmd/milvus/mck.go +++ b/cmd/milvus/mck.go @@ -528,40 +528,40 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e switch header.Base.MsgType { case commonpb.MsgType_LoadCollection: - loadReq := querypb.LoadCollectionRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadCollectionRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadCollectionRequest", err) } log.Info("LoadCollection", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadCollection", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_LoadPartitions: - loadReq := querypb.LoadPartitionsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadPartitionsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadPartitionsRequest", err) } log.Info("LoadPartitions", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadPartitions", loadReq.PartitionIDs, emptyInt64(), nil case commonpb.MsgType_ReleaseCollection: - loadReq := querypb.ReleaseCollectionRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleaseCollectionRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleaseCollectionRequest", err) } log.Info("ReleaseCollection", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleaseCollection", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_ReleasePartitions: - loadReq := querypb.ReleasePartitionsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleasePartitionsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleasePartitionsRequest", err) } log.Info("ReleasePartitions", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleasePartitions", loadReq.PartitionIDs, emptyInt64(), nil case commonpb.MsgType_LoadSegments: - loadReq := querypb.LoadSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadSegmentsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadSegmentsRequest", err) } @@ -584,16 +584,16 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e log.Info("LoadSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadSegments", removeRepeatElement(partitionIDs), removeRepeatElement(segmentIDs), nil case commonpb.MsgType_ReleaseSegments: - loadReq := querypb.ReleaseSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.ReleaseSegmentsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "ReleaseSegmentsRequest", err) } log.Info("ReleaseSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "ReleaseSegments", loadReq.PartitionIDs, loadReq.SegmentIDs, nil case commonpb.MsgType_WatchDmChannels: - loadReq := querypb.WatchDmChannelsRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.WatchDmChannelsRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "WatchDmChannelsRequest", err) } @@ -619,16 +619,16 @@ func (c *mck) unmarshalTask(taskID int64, t string) (string, []int64, []int64, e log.Warn("legacy WatchQueryChannels type found, ignore") return "WatchQueryChannels", emptyInt64(), emptyInt64(), nil case commonpb.MsgType_LoadBalanceSegments: - loadReq := querypb.LoadBalanceRequest{} - err = proto.Unmarshal([]byte(t), &loadReq) + loadReq := &querypb.LoadBalanceRequest{} + err = proto.Unmarshal([]byte(t), loadReq) if err != nil { return errReturn(taskID, "LoadBalanceRequest", err) } log.Info("LoadBalanceSegments", zap.String("detail", fmt.Sprintf("+%v", loadReq))) return "LoadBalanceSegments", emptyInt64(), loadReq.SealedSegmentIDs, nil case commonpb.MsgType_HandoffSegments: - handoffReq := querypb.HandoffSegmentsRequest{} - err = proto.Unmarshal([]byte(t), &handoffReq) + handoffReq := &querypb.HandoffSegmentsRequest{} + err = proto.Unmarshal([]byte(t), handoffReq) if err != nil { return errReturn(taskID, "HandoffSegmentsRequest", err) } diff --git a/configs/milvus.yaml b/configs/milvus.yaml index f47f02d507ea0..a38036c7c1c19 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -431,7 +431,7 @@ dataCoord: maxSize: 1024 # Maximum size of a segment in MB diskSegmentMaxSize: 2048 # Maximun size of a segment in MB for collection which has Disk index sealProportion: 0.12 - sealProportionJitter: 0.1 # segment seal proportion jitter ratio, default value 0.1(10%), if seal propertion is 12%, with jitter=0.1, the actuall applied ratio will be 10.8~12% + sealProportionJitter: 0.1 # segment seal proportion jitter ratio, default value 0.1(10%), if seal proportion is 12%, with jitter=0.1, the actuall applied ratio will be 10.8~12% assignmentExpiration: 2000 # The time of the assignment expiration in ms allocLatestExpireAttempt: 200 # The time attempting to alloc latest lastExpire from rootCoord after restart maxLife: 86400 # The max lifetime of segment in seconds, 24*60*60 diff --git a/internal/core/src/common/QueryResult.h b/internal/core/src/common/QueryResult.h index aa4d79911e191..b5298d01b4346 100644 --- a/internal/core/src/common/QueryResult.h +++ b/internal/core/src/common/QueryResult.h @@ -107,8 +107,8 @@ struct VectorIterator { for (auto& iter : iterators_) { if (iter->HasNext()) { auto origin_pair = iter->Next(); - origin_pair.first = convert_to_segment_offset( - origin_pair.first, idx); + origin_pair.first = + convert_to_segment_offset(origin_pair.first, idx); auto off_dis_pair = std::make_shared(origin_pair, idx++); heap_.push(off_dis_pair); diff --git a/internal/core/src/common/Tracer.cpp b/internal/core/src/common/Tracer.cpp index bab42c81366ba..70544c69992f6 100644 --- a/internal/core/src/common/Tracer.cpp +++ b/internal/core/src/common/Tracer.cpp @@ -64,8 +64,8 @@ initTelemetry(const TraceConfig& cfg) { opts.url = cfg.otlpEndpoint; exporter = otlp::OtlpHttpExporterFactory::Create(opts); LOG_INFO("init otlp http exporter, endpoint: {}", opts.url); - } else if (cfg.otlpMethod == "grpc" || - cfg.otlpMethod == "") { // legacy configuration + } else if (cfg.otlpMethod == "grpc" || + cfg.otlpMethod == "") { // legacy configuration auto opts = otlp::OtlpGrpcExporterOptions{}; opts.endpoint = cfg.otlpEndpoint; opts.use_ssl_credentials = cfg.oltpSecure; diff --git a/internal/core/src/exec/expression/UnaryExpr.cpp b/internal/core/src/exec/expression/UnaryExpr.cpp index 6e2655ed959e4..6662868d436d5 100644 --- a/internal/core/src/exec/expression/UnaryExpr.cpp +++ b/internal/core/src/exec/expression/UnaryExpr.cpp @@ -364,7 +364,7 @@ PhyUnaryRangeFilterExpr::ExecArrayEqualForIndex(bool reverse) { // filtering by index, get candidates. auto size_per_chunk = segment_->size_per_chunk(); - auto retrieve = [size_per_chunk, this](int64_t offset) -> auto { + auto retrieve = [ size_per_chunk, this ](int64_t offset) -> auto { auto chunk_idx = offset / size_per_chunk; auto chunk_offset = offset % size_per_chunk; const auto& chunk = diff --git a/internal/core/src/monitor/prometheus_client.cpp b/internal/core/src/monitor/prometheus_client.cpp index 9315c0e68f2ec..50ca5550559a2 100644 --- a/internal/core/src/monitor/prometheus_client.cpp +++ b/internal/core/src/monitor/prometheus_client.cpp @@ -47,12 +47,12 @@ const prometheus::Histogram::BucketBoundaries bytesBuckets = { 536870912, // 512M 1073741824}; // 1G -const prometheus::Histogram::BucketBoundaries ratioBuckets = - {0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, - 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0}; +const prometheus::Histogram::BucketBoundaries ratioBuckets = { + 0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, + 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0}; -const std::unique_ptr - prometheusClient = std::make_unique(); +const std::unique_ptr prometheusClient = + std::make_unique(); /******************GetMetrics************************************************************* * !!! NOT use SUMMARY metrics here, because when parse SUMMARY metrics in Milvus, diff --git a/internal/core/src/query/SubSearchResult.h b/internal/core/src/query/SubSearchResult.h index c5b04ef1a3462..40fe913896896 100644 --- a/internal/core/src/query/SubSearchResult.h +++ b/internal/core/src/query/SubSearchResult.h @@ -22,12 +22,11 @@ namespace milvus::query { class SubSearchResult { public: - SubSearchResult( - int64_t num_queries, - int64_t topk, - const MetricType& metric_type, - int64_t round_decimal, - const std::vector& iters) + SubSearchResult(int64_t num_queries, + int64_t topk, + const MetricType& metric_type, + int64_t round_decimal, + const std::vector& iters) : num_queries_(num_queries), topk_(topk), round_decimal_(round_decimal), @@ -41,12 +40,11 @@ class SubSearchResult { int64_t topk, const MetricType& metric_type, int64_t round_decimal) - : SubSearchResult( - num_queries, - topk, - metric_type, - round_decimal, - std::vector{}) { + : SubSearchResult(num_queries, + topk, + metric_type, + round_decimal, + std::vector{}) { } SubSearchResult(SubSearchResult&& other) noexcept @@ -130,8 +128,7 @@ class SubSearchResult { knowhere::MetricType metric_type_; std::vector seg_offsets_; std::vector distances_; - std::vector - chunk_iterators_; + std::vector chunk_iterators_; }; } // namespace milvus::query diff --git a/internal/core/src/query/groupby/SearchGroupByOperator.h b/internal/core/src/query/groupby/SearchGroupByOperator.h index 5b0c6e2e274bd..dc3d9d6777cea 100644 --- a/internal/core/src/query/groupby/SearchGroupByOperator.h +++ b/internal/core/src/query/groupby/SearchGroupByOperator.h @@ -206,7 +206,7 @@ struct GroupByMap { } bool Push(const T& t) { - if (group_map_.size() >= group_capacity_ && group_map_[t] == 0){ + if (group_map_.size() >= group_capacity_ && group_map_[t] == 0) { return false; } if (group_map_[t] >= group_size_) { diff --git a/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp b/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp index 2cc21e912be5d..c5902fd63e7a9 100644 --- a/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp +++ b/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp @@ -236,8 +236,7 @@ ExecPlanNodeVisitor::VectorVisitorImpl(VectorPlanNode& node) { double total_cost = std::chrono::duration(vector_end - scalar_start) .count(); - double scalar_ratio = - total_cost > 0.0 ? scalar_cost / total_cost : 0.0; + double scalar_ratio = total_cost > 0.0 ? scalar_cost / total_cost : 0.0; monitor::internal_core_search_latency_scalar_proportion.Observe( scalar_ratio); } diff --git a/internal/core/src/segcore/reduce/Reduce.cpp b/internal/core/src/segcore/reduce/Reduce.cpp index 0c26608aced17..9d71d258edba9 100644 --- a/internal/core/src/segcore/reduce/Reduce.cpp +++ b/internal/core/src/segcore/reduce/Reduce.cpp @@ -99,13 +99,13 @@ ReduceHelper::FilterInvalidSearchResult(SearchResult* search_result) { for (auto j = 0; j < topK; ++j) { auto index = i * topK + j; if (offsets[index] != INVALID_SEG_OFFSET) { - AssertInfo(0 <= offsets[index] && - offsets[index] < segment_row_count, - fmt::format("invalid offset {}, segment {} with " - "rows num {}, data or index corruption", - offsets[index], - segment->get_segment_id(), - segment_row_count)); + AssertInfo( + 0 <= offsets[index] && offsets[index] < segment_row_count, + fmt::format("invalid offset {}, segment {} with " + "rows num {}, data or index corruption", + offsets[index], + segment->get_segment_id(), + segment_row_count)); real_topks[i]++; offsets[valid_index] = offsets[index]; distances[valid_index] = distances[index]; @@ -167,9 +167,12 @@ ReduceHelper::RefreshSingleSearchResult(SearchResult* search_result, uint32_t index = 0; for (int j = 0; j < total_nq_; j++) { for (auto offset : final_search_records_[seg_res_idx][j]) { - search_result->primary_keys_[index] = search_result->primary_keys_[offset]; - search_result->distances_[index] = search_result->distances_[offset]; - search_result->seg_offsets_[index] = search_result->seg_offsets_[offset]; + search_result->primary_keys_[index] = + search_result->primary_keys_[offset]; + search_result->distances_[index] = + search_result->distances_[offset]; + search_result->seg_offsets_[index] = + search_result->seg_offsets_[offset]; index++; real_topks[j]++; } diff --git a/internal/core/src/storage/ChunkCache.cpp b/internal/core/src/storage/ChunkCache.cpp index a61111d6b20f5..91784f98ceef9 100644 --- a/internal/core/src/storage/ChunkCache.cpp +++ b/internal/core/src/storage/ChunkCache.cpp @@ -122,8 +122,12 @@ ChunkCache::Mmap(const FieldDataPtr& field_data, AssertInfo( false, "TODO: unimplemented for variable data type: {}", data_type); } else { - column = std::make_shared( - data_size, dim, data_type, mcm_, descriptor,field_data->IsNullable()); + column = std::make_shared(data_size, + dim, + data_type, + mcm_, + descriptor, + field_data->IsNullable()); } column->AppendBatch(field_data); return column; diff --git a/internal/core/unittest/test_array_inverted_index.cpp b/internal/core/unittest/test_array_inverted_index.cpp index d0be8976417ab..f0d59022bf43f 100644 --- a/internal/core/unittest/test_array_inverted_index.cpp +++ b/internal/core/unittest/test_array_inverted_index.cpp @@ -35,21 +35,21 @@ GenTestSchema() { schema_->set_primary_field_id(pk); if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::BOOL,false); + schema_->AddDebugArrayField("array", DataType::BOOL, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::INT8,false); + schema_->AddDebugArrayField("array", DataType::INT8, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::INT16,false); + schema_->AddDebugArrayField("array", DataType::INT16, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::INT32,false); + schema_->AddDebugArrayField("array", DataType::INT32, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::INT64,false); + schema_->AddDebugArrayField("array", DataType::INT64, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::FLOAT,false); + schema_->AddDebugArrayField("array", DataType::FLOAT, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::DOUBLE,false); + schema_->AddDebugArrayField("array", DataType::DOUBLE, false); } else if constexpr (std::is_same_v) { - schema_->AddDebugArrayField("array", DataType::VARCHAR,false); + schema_->AddDebugArrayField("array", DataType::VARCHAR, false); } return schema_; diff --git a/internal/core/unittest/test_utils/DataGen.h b/internal/core/unittest/test_utils/DataGen.h index a54841394b698..98234054a5408 100644 --- a/internal/core/unittest/test_utils/DataGen.h +++ b/internal/core/unittest/test_utils/DataGen.h @@ -318,16 +318,15 @@ GenerateRandomSparseFloatVector(size_t rows, return tensor; } -inline GeneratedData -DataGen(SchemaPtr schema, - int64_t N, - uint64_t seed = 42, - uint64_t pk_offset = 0, - uint64_t ts_offset = 0, - int repeat_count = 1, - int array_len = 10, - bool random_pk = false, - bool random_val = true) { +inline GeneratedData DataGen(SchemaPtr schema, + int64_t N, + uint64_t seed = 42, + uint64_t pk_offset = 0, + uint64_t ts_offset = 0, + int repeat_count = 1, + int array_len = 10, + bool random_pk = false, + bool random_val = true) { using std::vector; std::default_random_engine random(seed); std::normal_distribution<> distr(0, 1); diff --git a/internal/core/unittest/test_utils/c_api_test_utils.h b/internal/core/unittest/test_utils/c_api_test_utils.h index b500b635a56b5..34fe7d29cdf08 100644 --- a/internal/core/unittest/test_utils/c_api_test_utils.h +++ b/internal/core/unittest/test_utils/c_api_test_utils.h @@ -174,7 +174,6 @@ get_default_schema_config_nullable() { return conf.c_str(); } - CStatus CSearch(CSegmentInterface c_segment, CSearchPlan c_plan, diff --git a/internal/datacoord/services_test.go b/internal/datacoord/services_test.go index c71ba24e4cb6b..251fcd5544c40 100644 --- a/internal/datacoord/services_test.go +++ b/internal/datacoord/services_test.go @@ -75,7 +75,7 @@ func genMsg(msgType commonpb.MsgType, ch string, t Timestamp, sourceID int64) *m BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{0}, }, - DataNodeTtMsg: msgpb.DataNodeTtMsg{ + DataNodeTtMsg: &msgpb.DataNodeTtMsg{ Base: &commonpb.MsgBase{ MsgType: msgType, Timestamp: t, diff --git a/internal/datanode/compaction/clustering_compactor.go b/internal/datanode/compaction/clustering_compactor.go index bc94255bc3fa3..40279e43f295a 100644 --- a/internal/datanode/compaction/clustering_compactor.go +++ b/internal/datanode/compaction/clustering_compactor.go @@ -866,7 +866,7 @@ func (t *clusteringCompactionTask) packBufferToSegment(ctx context.Context, buff // clear segment binlogs cache delete(buffer.flushedBinlogs, writer.GetSegmentID()) - //set old writer nil + // set old writer nil writer = nil return nil } diff --git a/internal/datanode/util/testutils.go b/internal/datanode/util/testutils.go index 8cff202a12054..98b09b0f7e27d 100644 --- a/internal/datanode/util/testutils.go +++ b/internal/datanode/util/testutils.go @@ -665,7 +665,7 @@ func (df *DataFactory) GenMsgStreamInsertMsg(idx int, chanName string) *msgstrea BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{uint32(idx)}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -695,7 +695,7 @@ func (df *DataFactory) GenMsgStreamInsertMsgWithTs(idx int, chanName string, ts BeginTimestamp: ts, EndTimestamp: ts, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -745,7 +745,7 @@ func (df *DataFactory) GenMsgStreamDeleteMsg(pks []storage.PrimaryKey, chanName BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{uint32(idx)}, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 0, @@ -771,7 +771,7 @@ func (df *DataFactory) GenMsgStreamDeleteMsgWithTs(idx int, pks []storage.Primar BeginTimestamp: ts, EndTimestamp: ts, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, diff --git a/internal/distributed/proxy/httpserver/handler_test.go b/internal/distributed/proxy/httpserver/handler_test.go index cdfff887ca9fc..4b69022229a7c 100644 --- a/internal/distributed/proxy/httpserver/handler_test.go +++ b/internal/distributed/proxy/httpserver/handler_test.go @@ -209,7 +209,7 @@ func (m *mockProxyComponent) Query(ctx context.Context, request *milvuspb.QueryR return &queryResult, nil } -var flushResult = milvuspb.FlushResponse{ +var flushResult = &milvuspb.FlushResponse{ DbName: "default", } @@ -217,10 +217,10 @@ func (m *mockProxyComponent) Flush(ctx context.Context, request *milvuspb.FlushR if len(request.CollectionNames) < 1 { return nil, errors.New("body parse err") } - return &flushResult, nil + return flushResult, nil } -var calcDistanceResult = milvuspb.CalcDistanceResults{ +var calcDistanceResult = &milvuspb.CalcDistanceResults{ Array: &milvuspb.CalcDistanceResults_IntDist{ IntDist: &schemapb.IntArray{ Data: []int32{1, 2, 3}, @@ -232,7 +232,7 @@ func (m *mockProxyComponent) CalcDistance(ctx context.Context, request *milvuspb if len(request.Params) < 1 { return nil, errors.New("body parse err") } - return &calcDistanceResult, nil + return calcDistanceResult, nil } func (m *mockProxyComponent) GetFlushState(ctx context.Context, request *milvuspb.GetFlushStateRequest) (*milvuspb.GetFlushStateResponse, error) { diff --git a/internal/distributed/proxy/httpserver/handler_v2_test.go b/internal/distributed/proxy/httpserver/handler_v2_test.go index 1a97ebe7ff008..deaa09b6365c5 100644 --- a/internal/distributed/proxy/httpserver/handler_v2_test.go +++ b/internal/distributed/proxy/httpserver/handler_v2_test.go @@ -1359,10 +1359,10 @@ func TestSearchV2(t *testing.T) { bfloat16VectorField.Name = "bfloat16Vector" sparseFloatVectorField := generateVectorFieldSchema(schemapb.DataType_SparseFloatVector) sparseFloatVectorField.Name = "sparseFloatVector" - collSchema.Fields = append(collSchema.Fields, &binaryVectorField) - collSchema.Fields = append(collSchema.Fields, &float16VectorField) - collSchema.Fields = append(collSchema.Fields, &bfloat16VectorField) - collSchema.Fields = append(collSchema.Fields, &sparseFloatVectorField) + collSchema.Fields = append(collSchema.Fields, binaryVectorField) + collSchema.Fields = append(collSchema.Fields, float16VectorField) + collSchema.Fields = append(collSchema.Fields, bfloat16VectorField) + collSchema.Fields = append(collSchema.Fields, sparseFloatVectorField) mp.EXPECT().DescribeCollection(mock.Anything, mock.Anything).Return(&milvuspb.DescribeCollectionResponse{ CollectionName: DefaultCollectionName, Schema: collSchema, diff --git a/internal/distributed/proxy/httpserver/utils_test.go b/internal/distributed/proxy/httpserver/utils_test.go index e01958b6574ef..897728f38de51 100644 --- a/internal/distributed/proxy/httpserver/utils_test.go +++ b/internal/distributed/proxy/httpserver/utils_test.go @@ -27,8 +27,8 @@ const ( var DefaultScores = []float32{0.01, 0.04, 0.09} -func generatePrimaryField(datatype schemapb.DataType) schemapb.FieldSchema { - return schemapb.FieldSchema{ +func generatePrimaryField(datatype schemapb.DataType) *schemapb.FieldSchema { + return &schemapb.FieldSchema{ FieldID: common.StartOfUserFieldID, Name: FieldBookID, IsPrimaryKey: true, @@ -69,12 +69,12 @@ func generateIDs(dataType schemapb.DataType, num int) *schemapb.IDs { return nil } -func generateVectorFieldSchema(dataType schemapb.DataType) schemapb.FieldSchema { +func generateVectorFieldSchema(dataType schemapb.DataType) *schemapb.FieldSchema { dim := "2" if dataType == schemapb.DataType_BinaryVector { dim = "8" } - return schemapb.FieldSchema{ + return &schemapb.FieldSchema{ FieldID: common.StartOfUserFieldID + int64(dataType), IsPrimaryKey: false, DataType: dataType, @@ -97,14 +97,14 @@ func generateCollectionSchema(primaryDataType schemapb.DataType) *schemapb.Colle Description: "", AutoID: false, Fields: []*schemapb.FieldSchema{ - &primaryField, { + primaryField, { FieldID: common.StartOfUserFieldID + 1, Name: FieldWordCount, IsPrimaryKey: false, Description: "", DataType: 5, AutoID: false, - }, &vectorField, + }, vectorField, }, EnableDynamicField: true, } @@ -465,14 +465,14 @@ func TestPrimaryField(t *testing.T) { primaryField := generatePrimaryField(schemapb.DataType_Int64) field, ok := getPrimaryField(coll) assert.Equal(t, true, ok) - assert.Equal(t, primaryField, *field) + assert.EqualExportedValues(t, primaryField, field) assert.Equal(t, "1,2,3", joinArray([]int64{1, 2, 3})) assert.Equal(t, "1,2,3", joinArray([]string{"1", "2", "3"})) jsonStr := "{\"id\": [1, 2, 3]}" idStr := gjson.Get(jsonStr, "id") - rangeStr, err := convertRange(&primaryField, idStr) + rangeStr, err := convertRange(primaryField, idStr) assert.Equal(t, nil, err) assert.Equal(t, "1,2,3", rangeStr) filter, err := checkGetPrimaryKey(coll, idStr) @@ -482,7 +482,7 @@ func TestPrimaryField(t *testing.T) { primaryField = generatePrimaryField(schemapb.DataType_VarChar) jsonStr = "{\"id\": [\"1\", \"2\", \"3\"]}" idStr = gjson.Get(jsonStr, "id") - rangeStr, err = convertRange(&primaryField, idStr) + rangeStr, err = convertRange(primaryField, idStr) assert.Equal(t, nil, err) assert.Equal(t, `"1","2","3"`, rangeStr) coll2 := generateCollectionSchema(schemapb.DataType_VarChar) @@ -524,7 +524,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &floatVectorField, + primaryField, floatVectorField, }, EnableDynamicField: true, }) @@ -533,7 +533,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &binaryVectorField, + primaryField, binaryVectorField, }, EnableDynamicField: true, }) @@ -542,7 +542,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &float16VectorField, + primaryField, float16VectorField, }, EnableDynamicField: true, }) @@ -551,7 +551,7 @@ func TestInsertWithoutVector(t *testing.T) { err, _ = checkAndSetData(body, &schemapb.CollectionSchema{ Name: DefaultCollectionName, Fields: []*schemapb.FieldSchema{ - &primaryField, &bfloat16VectorField, + primaryField, bfloat16VectorField, }, EnableDynamicField: true, }) @@ -1293,7 +1293,7 @@ func TestVector(t *testing.T) { Description: "", AutoID: false, Fields: []*schemapb.FieldSchema{ - &primaryField, &floatVectorField, &binaryVectorField, &float16VectorField, &bfloat16VectorField, &sparseFloatVectorField, + primaryField, floatVectorField, binaryVectorField, float16VectorField, bfloat16VectorField, sparseFloatVectorField, }, EnableDynamicField: true, } diff --git a/internal/distributed/proxy/service.go b/internal/distributed/proxy/service.go index 445d0dc836cd5..898d7e5a823f3 100644 --- a/internal/distributed/proxy/service.go +++ b/internal/distributed/proxy/service.go @@ -188,7 +188,7 @@ func (s *Server) startHTTPServer(errChan chan error) { // Process request c.Next() - latency := time.Now().Sub(start) + latency := time.Since(start) metrics.RestfulReqLatency.WithLabelValues( strconv.FormatInt(paramtable.GetNodeID(), 10), path, ).Observe(float64(latency.Milliseconds())) diff --git a/internal/flushcommon/pipeline/data_sync_service_test.go b/internal/flushcommon/pipeline/data_sync_service_test.go index 7cd66e6e95a8e..9a5f3c2b1c60b 100644 --- a/internal/flushcommon/pipeline/data_sync_service_test.go +++ b/internal/flushcommon/pipeline/data_sync_service_test.go @@ -469,7 +469,7 @@ func (s *DataSyncServiceSuite) TestStartStop() { EndTimestamp: tsoutil.GetCurrentTime(), HashValues: []uint32{0}, }, - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: util.UniqueID(0), diff --git a/internal/flushcommon/pipeline/flow_graph_dd_node.go b/internal/flushcommon/pipeline/flow_graph_dd_node.go index 688adf5682913..b303680ab2dbb 100644 --- a/internal/flushcommon/pipeline/flow_graph_dd_node.go +++ b/internal/flushcommon/pipeline/flow_graph_dd_node.go @@ -181,11 +181,11 @@ func (ddn *ddNode) Operate(in []Msg) []Msg { continue } - util.RateCol.Add(metricsinfo.InsertConsumeThroughput, float64(proto.Size(&imsg.InsertRequest))) + util.RateCol.Add(metricsinfo.InsertConsumeThroughput, float64(proto.Size(imsg.InsertRequest))) metrics.DataNodeConsumeBytesCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.InsertLabel). - Add(float64(proto.Size(&imsg.InsertRequest))) + Add(float64(proto.Size(imsg.InsertRequest))) metrics.DataNodeConsumeMsgCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.InsertLabel, fmt.Sprint(ddn.collectionID)). @@ -215,11 +215,11 @@ func (ddn *ddNode) Operate(in []Msg) []Msg { } log.Debug("DDNode receive delete messages", zap.String("channel", ddn.vChannelName), zap.Int64("numRows", dmsg.NumRows)) - util.RateCol.Add(metricsinfo.DeleteConsumeThroughput, float64(proto.Size(&dmsg.DeleteRequest))) + util.RateCol.Add(metricsinfo.DeleteConsumeThroughput, float64(proto.Size(dmsg.DeleteRequest))) metrics.DataNodeConsumeBytesCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.DeleteLabel). - Add(float64(proto.Size(&dmsg.DeleteRequest))) + Add(float64(proto.Size(dmsg.DeleteRequest))) metrics.DataNodeConsumeMsgCount. WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.DeleteLabel, fmt.Sprint(ddn.collectionID)). diff --git a/internal/flushcommon/pipeline/flow_graph_dd_node_test.go b/internal/flushcommon/pipeline/flow_graph_dd_node_test.go index 794c6f5cab452..8e234457b1c7b 100644 --- a/internal/flushcommon/pipeline/flow_graph_dd_node_test.go +++ b/internal/flushcommon/pipeline/flow_graph_dd_node_test.go @@ -147,7 +147,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { } var dropCollMsg msgstream.TsMsg = &msgstream.DropCollectionMsg{ - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropCollection}, CollectionID: test.msgCollID, }, @@ -200,7 +200,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { } var dropPartMsg msgstream.TsMsg = &msgstream.DropPartitionMsg{ - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropPartition}, CollectionID: test.msgCollID, PartitionID: test.msgPartID, @@ -262,7 +262,7 @@ func TestFlowGraph_DDNode_Operate(t *testing.T) { EndTimestamp: test.MsgEndTs, HashValues: []uint32{0}, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Delete}, ShardName: "by-dev-rootcoord-dml-mock-0", CollectionID: test.inMsgCollID, @@ -596,7 +596,7 @@ func getInsertMsg(segmentID util.UniqueID, ts util.Timestamp) *msgstream.InsertM func getInsertMsgWithChannel(segmentID util.UniqueID, ts util.Timestamp, vChannelName string) *msgstream.InsertMsg { return &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{EndTimestamp: ts}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert}, SegmentID: segmentID, CollectionID: 1, diff --git a/internal/flushcommon/writebuffer/bf_write_buffer_test.go b/internal/flushcommon/writebuffer/bf_write_buffer_test.go index 77d6c38ed454d..ef4ea6b97a678 100644 --- a/internal/flushcommon/writebuffer/bf_write_buffer_test.go +++ b/internal/flushcommon/writebuffer/bf_write_buffer_test.go @@ -132,7 +132,7 @@ func (s *BFWriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim } flatten := lo.Flatten(vectors) return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ SegmentID: segmentID, Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, @@ -183,7 +183,7 @@ func (s *BFWriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim func (s *BFWriteBufferSuite) composeDeleteMsg(pks []storage.PrimaryKey) *msgstream.DeleteMsg { delMsg := &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ PrimaryKeys: storage.ParsePrimaryKeys2IDs(pks), Timestamps: lo.RepeatBy(len(pks), func(idx int) uint64 { return tsoutil.ComposeTSByTime(time.Now(), int64(idx+1)) }), }, diff --git a/internal/flushcommon/writebuffer/insert_buffer_test.go b/internal/flushcommon/writebuffer/insert_buffer_test.go index a55b286c88dce..bcb54aebc9f9f 100644 --- a/internal/flushcommon/writebuffer/insert_buffer_test.go +++ b/internal/flushcommon/writebuffer/insert_buffer_test.go @@ -53,7 +53,7 @@ func (s *InsertBufferSuite) composeInsertMsg(rowCount int, dim int) ([]int64, *m }) flatten := lo.Flatten(vectors) return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, Timestamps: lo.Map(tss, func(id int64, _ int) uint64 { return uint64(id) }), diff --git a/internal/flushcommon/writebuffer/l0_write_buffer_test.go b/internal/flushcommon/writebuffer/l0_write_buffer_test.go index 2cd16a2559770..6fb1239e8b8e2 100644 --- a/internal/flushcommon/writebuffer/l0_write_buffer_test.go +++ b/internal/flushcommon/writebuffer/l0_write_buffer_test.go @@ -103,7 +103,7 @@ func (s *L0WriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim } } return tss, &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ SegmentID: segmentID, Version: msgpb.InsertDataVersion_ColumnBased, RowIDs: tss, @@ -154,7 +154,7 @@ func (s *L0WriteBufferSuite) composeInsertMsg(segmentID int64, rowCount int, dim func (s *L0WriteBufferSuite) composeDeleteMsg(pks []storage.PrimaryKey) *msgstream.DeleteMsg { delMsg := &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ PrimaryKeys: storage.ParsePrimaryKeys2IDs(pks), Timestamps: lo.RepeatBy(len(pks), func(idx int) uint64 { return tsoutil.ComposeTSByTime(time.Now(), int64(idx)+1) }), }, diff --git a/internal/metastore/kv/rootcoord/kv_catalog_test.go b/internal/metastore/kv/rootcoord/kv_catalog_test.go index 1d3bbf12c2d0d..80b2682aadd8c 100644 --- a/internal/metastore/kv/rootcoord/kv_catalog_test.go +++ b/internal/metastore/kv/rootcoord/kv_catalog_test.go @@ -1282,7 +1282,7 @@ func TestCatalog_DropCollection(t *testing.T) { } func getUserInfoMetaString(username string) string { - validInfo := internalpb.CredentialInfo{Username: username, EncryptedPassword: "pwd" + username} + validInfo := &internalpb.CredentialInfo{Username: username, EncryptedPassword: "pwd" + username} validBytes, _ := json.Marshal(validInfo) return string(validBytes) } diff --git a/internal/proxy/accesslog/info/grpc_info.go b/internal/proxy/accesslog/info/grpc_info.go index 0b8de20677ca9..b42a6c4c7de28 100644 --- a/internal/proxy/accesslog/info/grpc_info.go +++ b/internal/proxy/accesslog/info/grpc_info.go @@ -28,13 +28,13 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" "github.com/milvus-io/milvus/internal/proxy/connection" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/requestutil" - "google.golang.org/protobuf/proto" ) type GrpcAccessInfo struct { diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index d6bfe8b5d7040..65383987c9ad7 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -2515,7 +2515,7 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest) BaseMsg: msgstream.BaseMsg{ HashValues: request.HashKeys, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithSourceID(paramtable.GetNodeID()), diff --git a/internal/proxy/impl_test.go b/internal/proxy/impl_test.go index 53f0ef9da172b..c9f7f2439ef3f 100644 --- a/internal/proxy/impl_test.go +++ b/internal/proxy/impl_test.go @@ -1421,14 +1421,13 @@ func TestProxy_ReplicateMessage(t *testing.T) { } { - timeTickResult := msgpb.TimeTickMsg{} timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: 1, EndTimestamp: 10, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{}, } msgBytes, _ := timeTickMsg.Marshal(timeTickMsg) resp, err := node.ReplicateMessage(context.TODO(), &milvuspb.ReplicateMessageRequest{ @@ -1441,20 +1440,19 @@ func TestProxy_ReplicateMessage(t *testing.T) { } { - timeTickResult := msgpb.TimeTickMsg{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType(-1)), - commonpbutil.WithTimeStamp(10), - commonpbutil.WithSourceID(-1), - ), - } timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: 1, EndTimestamp: 10, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType(-1)), + commonpbutil.WithTimeStamp(10), + commonpbutil.WithSourceID(-1), + ), + }, } msgBytes, _ := timeTickMsg.Marshal(timeTickMsg) resp, err := node.ReplicateMessage(context.TODO(), &milvuspb.ReplicateMessageRequest{ @@ -1512,7 +1510,7 @@ func TestProxy_ReplicateMessage(t *testing.T) { MsgID: []byte("mock message id 2"), }, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 10001, diff --git a/internal/proxy/msg_pack.go b/internal/proxy/msg_pack.go index 1177bd8adc1dd..426cc0a9d1f7b 100644 --- a/internal/proxy/msg_pack.go +++ b/internal/proxy/msg_pack.go @@ -50,7 +50,7 @@ func genInsertMsgsByPartition(ctx context.Context, // create empty insert message createInsertMsg := func(segmentID UniqueID, channelName string) *msgstream.InsertMsg { - insertReq := msgpb.InsertRequest{ + insertReq := &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithTimeStamp(insertMsg.BeginTimestamp), // entity's timestamp was set to equal it.BeginTimestamp in preExecute() @@ -63,9 +63,8 @@ func genInsertMsgsByPartition(ctx context.Context, SegmentID: segmentID, ShardName: channelName, Version: msgpb.InsertDataVersion_ColumnBased, + FieldsData: make([]*schemapb.FieldData, len(insertMsg.GetFieldsData())), } - insertReq.FieldsData = make([]*schemapb.FieldData, len(insertMsg.GetFieldsData())) - msg := &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{ Ctx: ctx, diff --git a/internal/proxy/msg_pack_test.go b/internal/proxy/msg_pack_test.go index 731edbb7d7b97..29873f11b0821 100644 --- a/internal/proxy/msg_pack_test.go +++ b/internal/proxy/msg_pack_test.go @@ -91,7 +91,7 @@ func TestRepackInsertData(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -201,7 +201,7 @@ func TestRepackInsertDataWithPartitionKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/proxy/task.go b/internal/proxy/task.go index d111d631ede19..fc01844170408 100644 --- a/internal/proxy/task.go +++ b/internal/proxy/task.go @@ -459,7 +459,6 @@ func (t *dropCollectionTask) OnEnqueue() error { } func (t *dropCollectionTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(t.CollectionName); err != nil { return err } @@ -527,7 +526,6 @@ func (t *hasCollectionTask) OnEnqueue() error { } func (t *hasCollectionTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(t.CollectionName); err != nil { return err } @@ -595,7 +593,6 @@ func (t *describeCollectionTask) OnEnqueue() error { } func (t *describeCollectionTask) PreExecute(ctx context.Context) error { - if t.CollectionID != 0 && len(t.CollectionName) == 0 { return nil } @@ -935,7 +932,6 @@ func validatePartitionKeyIsolation(colName string, isPartitionKeyEnabled bool, p } func (t *alterCollectionTask) PreExecute(ctx context.Context) error { - collectionID, err := globalMetaCache.GetCollectionID(ctx, t.GetDbName(), t.CollectionName) if err != nil { return err @@ -1072,7 +1068,6 @@ func (t *createPartitionTask) OnEnqueue() error { } func (t *createPartitionTask) PreExecute(ctx context.Context) error { - collName, partitionTag := t.CollectionName, t.PartitionName if err := validateCollectionName(collName); err != nil { @@ -1155,7 +1150,6 @@ func (t *dropPartitionTask) OnEnqueue() error { } func (t *dropPartitionTask) PreExecute(ctx context.Context) error { - collName, partitionTag := t.CollectionName, t.PartitionName if err := validateCollectionName(collName); err != nil { @@ -1263,7 +1257,6 @@ func (t *hasPartitionTask) OnEnqueue() error { } func (t *hasPartitionTask) PreExecute(ctx context.Context) error { - collName, partitionTag := t.CollectionName, t.PartitionName if err := validateCollectionName(collName); err != nil { @@ -1337,7 +1330,6 @@ func (t *showPartitionsTask) OnEnqueue() error { } func (t *showPartitionsTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(t.CollectionName); err != nil { return err } @@ -1742,7 +1734,6 @@ func (t *releaseCollectionTask) OnEnqueue() error { } func (t *releaseCollectionTask) PreExecute(ctx context.Context) error { - collName := t.CollectionName if err := validateCollectionName(collName); err != nil { @@ -1836,7 +1827,6 @@ func (t *loadPartitionsTask) OnEnqueue() error { } func (t *loadPartitionsTask) PreExecute(ctx context.Context) error { - collName := t.CollectionName if err := validateCollectionName(collName); err != nil { @@ -1986,7 +1976,6 @@ func (t *releasePartitionsTask) OnEnqueue() error { } func (t *releasePartitionsTask) PreExecute(ctx context.Context) error { - collName := t.CollectionName if err := validateCollectionName(collName); err != nil { @@ -2091,7 +2080,6 @@ func (t *CreateResourceGroupTask) OnEnqueue() error { } func (t *CreateResourceGroupTask) PreExecute(ctx context.Context) error { - return nil } @@ -2156,7 +2144,6 @@ func (t *UpdateResourceGroupsTask) OnEnqueue() error { } func (t *UpdateResourceGroupsTask) PreExecute(ctx context.Context) error { - return nil } @@ -2224,7 +2211,6 @@ func (t *DropResourceGroupTask) OnEnqueue() error { } func (t *DropResourceGroupTask) PreExecute(ctx context.Context) error { - return nil } @@ -2289,7 +2275,6 @@ func (t *DescribeResourceGroupTask) OnEnqueue() error { } func (t *DescribeResourceGroupTask) PreExecute(ctx context.Context) error { - return nil } @@ -2415,7 +2400,6 @@ func (t *TransferNodeTask) OnEnqueue() error { } func (t *TransferNodeTask) PreExecute(ctx context.Context) error { - return nil } @@ -2480,7 +2464,6 @@ func (t *TransferReplicaTask) OnEnqueue() error { } func (t *TransferReplicaTask) PreExecute(ctx context.Context) error { - return nil } @@ -2554,7 +2537,6 @@ func (t *ListResourceGroupsTask) OnEnqueue() error { } func (t *ListResourceGroupsTask) PreExecute(ctx context.Context) error { - return nil } diff --git a/internal/proxy/task_alias.go b/internal/proxy/task_alias.go index 5d46fbfe8c977..c8b9164620c5b 100644 --- a/internal/proxy/task_alias.go +++ b/internal/proxy/task_alias.go @@ -89,7 +89,6 @@ func (t *CreateAliasTask) OnEnqueue() error { // PreExecute defines the tion before task execution func (t *CreateAliasTask) PreExecute(ctx context.Context) error { - collAlias := t.Alias // collection alias uses the same format as collection name if err := ValidateCollectionAlias(collAlias); err != nil { @@ -240,7 +239,6 @@ func (t *AlterAliasTask) OnEnqueue() error { } func (t *AlterAliasTask) PreExecute(ctx context.Context) error { - collAlias := t.Alias // collection alias uses the same format as collection name if err := ValidateCollectionAlias(collAlias); err != nil { @@ -384,7 +382,6 @@ func (a *ListAliasesTask) OnEnqueue() error { } func (a *ListAliasesTask) PreExecute(ctx context.Context) error { - if len(a.GetCollectionName()) > 0 { if err := validateCollectionName(a.GetCollectionName()); err != nil { return err diff --git a/internal/proxy/task_database.go b/internal/proxy/task_database.go index 32c19117171da..1b26169f09c28 100644 --- a/internal/proxy/task_database.go +++ b/internal/proxy/task_database.go @@ -272,7 +272,6 @@ func (t *alterDatabaseTask) OnEnqueue() error { } func (t *alterDatabaseTask) PreExecute(ctx context.Context) error { - return nil } @@ -351,7 +350,6 @@ func (t *describeDatabaseTask) OnEnqueue() error { } func (t *describeDatabaseTask) PreExecute(ctx context.Context) error { - return nil } diff --git a/internal/proxy/task_delete.go b/internal/proxy/task_delete.go index a41cacd53dea6..68137396210cb 100644 --- a/internal/proxy/task_delete.go +++ b/internal/proxy/task_delete.go @@ -202,26 +202,25 @@ func (dt *deleteTask) newDeleteMsg(ctx context.Context) (*msgstream.DeleteMsg, e if err != nil { return nil, errors.Wrap(err, "failed to allocate MsgID of delete") } - sliceRequest := msgpb.DeleteRequest{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType_Delete), - // msgid of delete msg must be set - // or it will be seen as duplicated msg in mq - commonpbutil.WithMsgID(msgid), - commonpbutil.WithTimeStamp(dt.ts), - commonpbutil.WithSourceID(paramtable.GetNodeID()), - ), - CollectionID: dt.collectionID, - PartitionID: dt.partitionID, - CollectionName: dt.req.GetCollectionName(), - PartitionName: dt.req.GetPartitionName(), - PrimaryKeys: &schemapb.IDs{}, - } return &msgstream.DeleteMsg{ BaseMsg: msgstream.BaseMsg{ Ctx: ctx, }, - DeleteRequest: sliceRequest, + DeleteRequest: &msgpb.DeleteRequest{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType_Delete), + // msgid of delete msg must be set + // or it will be seen as duplicated msg in mq + commonpbutil.WithMsgID(msgid), + commonpbutil.WithTimeStamp(dt.ts), + commonpbutil.WithSourceID(paramtable.GetNodeID()), + ), + CollectionID: dt.collectionID, + PartitionID: dt.partitionID, + CollectionName: dt.req.GetCollectionName(), + PartitionName: dt.req.GetPartitionName(), + PrimaryKeys: &schemapb.IDs{}, + }, }, nil } diff --git a/internal/proxy/task_index.go b/internal/proxy/task_index.go index 1b844cc2113fa..dfa70e33744d7 100644 --- a/internal/proxy/task_index.go +++ b/internal/proxy/task_index.go @@ -171,9 +171,8 @@ func (cit *createIndexTask) parseIndexParams() error { return Params.AutoIndexConfig.ScalarIntIndexType.GetValue() } else if typeutil.IsFloatingType(dataType) { return Params.AutoIndexConfig.ScalarFloatIndexType.GetValue() - } else { - return Params.AutoIndexConfig.ScalarVarcharIndexType.GetValue() } + return Params.AutoIndexConfig.ScalarVarcharIndexType.GetValue() } indexType, err := func() (string, error) { @@ -182,17 +181,14 @@ func (cit *createIndexTask) parseIndexParams() error { return getPrimitiveIndexType(dataType), nil } else if typeutil.IsArrayType(dataType) { return getPrimitiveIndexType(cit.fieldSchema.ElementType), nil - } else { - return "", fmt.Errorf("create auto index on type:%s is not supported", dataType.String()) } + return "", fmt.Errorf("create auto index on type:%s is not supported", dataType.String()) }() - if err != nil { return merr.WrapErrParameterInvalid("supported field", err.Error()) } indexParamsMap[common.IndexTypeKey] = indexType - } } else { specifyIndexType, exist := indexParamsMap[common.IndexTypeKey] @@ -440,7 +436,6 @@ func checkTrain(field *schemapb.FieldSchema, indexParams map[string]string) erro } func (cit *createIndexTask) PreExecute(ctx context.Context) error { - collName := cit.req.GetCollectionName() collID, err := globalMetaCache.GetCollectionID(ctx, cit.req.GetDbName(), collName) @@ -554,7 +549,6 @@ func (t *alterIndexTask) OnEnqueue() error { } func (t *alterIndexTask) PreExecute(ctx context.Context) error { - for _, param := range t.req.GetExtraParams() { if !indexparams.IsConfigableIndexParam(param.GetKey()) { return merr.WrapErrParameterInvalidMsg("%s is not configable index param", param.GetKey()) @@ -666,7 +660,6 @@ func (dit *describeIndexTask) OnEnqueue() error { } func (dit *describeIndexTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(dit.CollectionName); err != nil { return err } @@ -791,7 +784,6 @@ func (dit *getIndexStatisticsTask) OnEnqueue() error { } func (dit *getIndexStatisticsTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(dit.CollectionName); err != nil { return err } @@ -909,7 +901,6 @@ func (dit *dropIndexTask) OnEnqueue() error { } func (dit *dropIndexTask) PreExecute(ctx context.Context) error { - collName, fieldName := dit.CollectionName, dit.FieldName if err := validateCollectionName(collName); err != nil { @@ -1020,7 +1011,6 @@ func (gibpt *getIndexBuildProgressTask) OnEnqueue() error { } func (gibpt *getIndexBuildProgressTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(gibpt.CollectionName); err != nil { return err } @@ -1110,7 +1100,6 @@ func (gist *getIndexStateTask) OnEnqueue() error { } func (gist *getIndexStateTask) PreExecute(ctx context.Context) error { - if err := validateCollectionName(gist.CollectionName); err != nil { return err } diff --git a/internal/proxy/task_index_test.go b/internal/proxy/task_index_test.go index 3a659b98ea0f0..47251cc2edf72 100644 --- a/internal/proxy/task_index_test.go +++ b/internal/proxy/task_index_test.go @@ -55,6 +55,7 @@ func sortKeyValuePairs(pairs []*commonpb.KeyValuePair) { return pairs[i].Key > pairs[j].Key }) } + func TestGetIndexStateTask_Execute(t *testing.T) { dbName := funcutil.GenRandomStr() collectionName := funcutil.GenRandomStr() @@ -617,8 +618,10 @@ func Test_parseIndexParams(t *testing.T) { err := cit.parseIndexParams() assert.NoError(t, err) sortKeyValuePairs(cit.newIndexParams) - assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, - {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}}) + assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{ + {Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, + {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}, + }) }) t.Run("create index on Arithmetic field", func(t *testing.T) { @@ -659,8 +662,10 @@ func Test_parseIndexParams(t *testing.T) { err := cit.parseIndexParams() assert.NoError(t, err) sortKeyValuePairs(cit.newIndexParams) - assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, - {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}}) + assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{ + {Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, + {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}, + }) }) // Compatible with the old version <= 2.3.0 @@ -886,8 +891,10 @@ func Test_parseIndexParams(t *testing.T) { err = cit.parseIndexParams() assert.NoError(t, err) sortKeyValuePairs(cit.newIndexParams) - assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, - {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}}) + assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{ + {Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, + {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}, + }) }) t.Run("create auto index on numeric field", func(t *testing.T) { @@ -914,8 +921,10 @@ func Test_parseIndexParams(t *testing.T) { err := cit.parseIndexParams() assert.NoError(t, err) sortKeyValuePairs(cit.newIndexParams) - assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, - {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}}) + assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{ + {Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, + {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}, + }) }) t.Run("create auto index on varchar field", func(t *testing.T) { @@ -942,8 +951,10 @@ func Test_parseIndexParams(t *testing.T) { err := cit.parseIndexParams() assert.NoError(t, err) sortKeyValuePairs(cit.newIndexParams) - assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{{Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, - {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}}) + assert.Equal(t, cit.newIndexParams, []*commonpb.KeyValuePair{ + {Key: common.IndexTypeKey, Value: indexparamcheck.IndexHybrid}, + {Key: common.BitmapCardinalityLimitKey, Value: strconv.Itoa(paramtable.DefaultBitmapIndexCardinalityBound)}, + }) }) t.Run("create auto index on json field", func(t *testing.T) { diff --git a/internal/proxy/task_insert_test.go b/internal/proxy/task_insert_test.go index fb5b1c051a31f..cdf90290567ce 100644 --- a/internal/proxy/task_insert_test.go +++ b/internal/proxy/task_insert_test.go @@ -22,7 +22,7 @@ func TestInsertTask_CheckAligned(t *testing.T) { // passed NumRows is less than 0 case1 := insertTask{ insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -52,7 +52,7 @@ func TestInsertTask_CheckAligned(t *testing.T) { dim := 128 case2 := insertTask{ insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -275,7 +275,7 @@ func TestInsertTask(t *testing.T) { it := insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: collectionName, }, }, @@ -297,7 +297,7 @@ func TestMaxInsertSize(t *testing.T) { it := insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ DbName: "hooooooo", CollectionName: "fooooo", }, diff --git a/internal/proxy/task_scheduler_test.go b/internal/proxy/task_scheduler_test.go index 771a5eb9f1d86..9b16150b4cf5e 100644 --- a/internal/proxy/task_scheduler_test.go +++ b/internal/proxy/task_scheduler_test.go @@ -582,7 +582,7 @@ func TestTaskScheduler_concurrentPushAndPop(t *testing.T) { it := &insertTask{ ctx: context.Background(), insertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{}, CollectionName: collectionName, }, diff --git a/internal/proxy/task_test.go b/internal/proxy/task_test.go index a74c2538e984e..06f80220ef588 100644 --- a/internal/proxy/task_test.go +++ b/internal/proxy/task_test.go @@ -1712,7 +1712,7 @@ func TestTask_Int64PrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1906,7 +1906,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1962,7 +1962,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1979,7 +1979,7 @@ func TestTask_VarCharPrimaryKey(t *testing.T) { BaseMsg: msgstream.BaseMsg{ HashValues: hash, }, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 0, @@ -3325,7 +3325,7 @@ func TestPartitionKey(t *testing.T) { it := &insertTask{ insertMsg: &BaseInsertTask{ BaseMsg: msgstream.BaseMsg{}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/proxy/task_upsert.go b/internal/proxy/task_upsert.go index 8132430c67b64..2b17bc217a9bd 100644 --- a/internal/proxy/task_upsert.go +++ b/internal/proxy/task_upsert.go @@ -321,7 +321,7 @@ func (it *upsertTask) PreExecute(ctx context.Context) error { it.upsertMsg = &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithSourceID(paramtable.GetNodeID()), @@ -335,7 +335,7 @@ func (it *upsertTask) PreExecute(ctx context.Context) error { }, }, DeleteMsg: &msgstream.DeleteMsg{ - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithSourceID(paramtable.GetNodeID()), @@ -463,7 +463,7 @@ func (it *upsertTask) deleteExecute(ctx context.Context, msgPack *msgstream.MsgP if err != nil { errors.Wrap(err, "failed to allocate MsgID for delete of upsert") } - sliceRequest := msgpb.DeleteRequest{ + sliceRequest := &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithTimeStamp(ts), diff --git a/internal/proxy/task_upsert_test.go b/internal/proxy/task_upsert_test.go index c3331b047f861..f2f9b87b16651 100644 --- a/internal/proxy/task_upsert_test.go +++ b/internal/proxy/task_upsert_test.go @@ -41,11 +41,11 @@ func TestUpsertTask_CheckAligned(t *testing.T) { }, upsertMsg: &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{}, + InsertRequest: &msgpb.InsertRequest{}, }, }, } - case1.upsertMsg.InsertMsg.InsertRequest = msgpb.InsertRequest{ + case1.upsertMsg.InsertMsg.InsertRequest = &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), ), @@ -102,7 +102,7 @@ func TestUpsertTask_CheckAligned(t *testing.T) { schema: schema, upsertMsg: &msgstream.UpsertMsg{ InsertMsg: &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{}, + InsertRequest: &msgpb.InsertRequest{}, }, }, } @@ -120,7 +120,7 @@ func TestUpsertTask_CheckAligned(t *testing.T) { newBinaryVectorFieldData("BinaryVector", numRows, dim), newScalarFieldData(varCharFieldSchema, "VarChar", numRows), } - case2.upsertMsg.InsertMsg.InsertRequest = msgpb.InsertRequest{ + case2.upsertMsg.InsertMsg.InsertRequest = &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), ), diff --git a/internal/proxy/util.go b/internal/proxy/util.go index 839899c3c4e22..bf9f77c692cb4 100644 --- a/internal/proxy/util.go +++ b/internal/proxy/util.go @@ -1533,52 +1533,52 @@ func SendReplicateMessagePack(ctx context.Context, replicateMsgStream msgstream. case *milvuspb.CreateDatabaseRequest: tsMsg = &msgstream.CreateDatabaseMsg{ BaseMsg: getBaseMsg(ctx, ts), - CreateDatabaseRequest: *r, + CreateDatabaseRequest: r, } case *milvuspb.DropDatabaseRequest: tsMsg = &msgstream.DropDatabaseMsg{ BaseMsg: getBaseMsg(ctx, ts), - DropDatabaseRequest: *r, + DropDatabaseRequest: r, } case *milvuspb.FlushRequest: tsMsg = &msgstream.FlushMsg{ BaseMsg: getBaseMsg(ctx, ts), - FlushRequest: *r, + FlushRequest: r, } case *milvuspb.LoadCollectionRequest: tsMsg = &msgstream.LoadCollectionMsg{ BaseMsg: getBaseMsg(ctx, ts), - LoadCollectionRequest: *r, + LoadCollectionRequest: r, } case *milvuspb.ReleaseCollectionRequest: tsMsg = &msgstream.ReleaseCollectionMsg{ BaseMsg: getBaseMsg(ctx, ts), - ReleaseCollectionRequest: *r, + ReleaseCollectionRequest: r, } case *milvuspb.CreateIndexRequest: tsMsg = &msgstream.CreateIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - CreateIndexRequest: *r, + CreateIndexRequest: r, } case *milvuspb.DropIndexRequest: tsMsg = &msgstream.DropIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - DropIndexRequest: *r, + DropIndexRequest: r, } case *milvuspb.LoadPartitionsRequest: tsMsg = &msgstream.LoadPartitionsMsg{ BaseMsg: getBaseMsg(ctx, ts), - LoadPartitionsRequest: *r, + LoadPartitionsRequest: r, } case *milvuspb.ReleasePartitionsRequest: tsMsg = &msgstream.ReleasePartitionsMsg{ BaseMsg: getBaseMsg(ctx, ts), - ReleasePartitionsRequest: *r, + ReleasePartitionsRequest: r, } case *milvuspb.AlterIndexRequest: tsMsg = &msgstream.AlterIndexMsg{ BaseMsg: getBaseMsg(ctx, ts), - AlterIndexRequest: *r, + AlterIndexRequest: r, } default: log.Warn("unknown request", zap.Any("request", request)) diff --git a/internal/proxy/util_test.go b/internal/proxy/util_test.go index a3a3532e4e724..12cecd23f97ed 100644 --- a/internal/proxy/util_test.go +++ b/internal/proxy/util_test.go @@ -1137,7 +1137,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1170,7 +1170,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1211,7 +1211,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1241,7 +1241,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1270,7 +1270,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1298,7 +1298,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1332,7 +1332,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1376,7 +1376,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1410,7 +1410,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1443,7 +1443,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1476,7 +1476,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1518,7 +1518,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1560,7 +1560,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1603,7 +1603,7 @@ func Test_InsertTaskcheckFieldsDataBySchema(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1639,7 +1639,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1674,7 +1674,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1716,7 +1716,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1758,7 +1758,7 @@ func Test_InsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1804,7 +1804,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { Fields: []*schemapb.FieldSchema{}, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1841,7 +1841,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1884,7 +1884,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1929,7 +1929,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -1974,7 +1974,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2020,7 +2020,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2059,7 +2059,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2100,7 +2100,7 @@ func Test_UpsertTaskCheckPrimaryFieldData(t *testing.T) { }, }, insertMsg: &BaseInsertTask{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, }, @@ -2230,7 +2230,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2259,7 +2259,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2287,7 +2287,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData(jsonData) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2303,7 +2303,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { jsonFieldData := autoGenDynamicFieldData([][]byte{[]byte(data)}) schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{jsonFieldData}, NumRows: 1, @@ -2316,7 +2316,7 @@ func Test_CheckDynamicFieldData(t *testing.T) { t.Run("no json data", func(t *testing.T) { schema := newTestSchema() insertMsg := &msgstream.InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ CollectionName: "collectionName", FieldsData: []*schemapb.FieldData{}, NumRows: 1, diff --git a/internal/querycoordv2/balance/score_based_balancer_test.go b/internal/querycoordv2/balance/score_based_balancer_test.go index b125a9ead97e8..3cf72e9797068 100644 --- a/internal/querycoordv2/balance/score_based_balancer_test.go +++ b/internal/querycoordv2/balance/score_based_balancer_test.go @@ -568,6 +568,7 @@ func (suite *ScoreBasedBalancerTestSuite) TestDelegatorPreserveMemory() { segmentPlans, channelPlans = suite.getCollectionBalancePlans(balancer, c.collectionID) suite.Len(segmentPlans, 1) suite.Equal(segmentPlans[0].To, int64(2)) + suite.Len(channelPlans, 0) }) } } diff --git a/internal/querynodev2/delegator/delegator_data_test.go b/internal/querynodev2/delegator/delegator_data_test.go index a44907fd617f4..41b3db3853041 100644 --- a/internal/querynodev2/delegator/delegator_data_test.go +++ b/internal/querynodev2/delegator/delegator_data_test.go @@ -1198,10 +1198,10 @@ func (s *DelegatorDataSuite) TestReadDeleteFromMsgstream() { datas := []*msgstream.MsgPack{ {EndTs: 10, EndPositions: []*msgpb.MsgPosition{{Timestamp: 10}}, Msgs: []msgstream.TsMsg{ - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 1, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{1}}}, - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: -1, PrimaryKeys: storage.ParseInt64s2IDs(2), Timestamps: []uint64{5}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 1, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{1}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: -1, PrimaryKeys: storage.ParseInt64s2IDs(2), Timestamps: []uint64{5}}}, // invalid msg because partition wrong - &msgstream.DeleteMsg{DeleteRequest: msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 2, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{10}}}, + &msgstream.DeleteMsg{DeleteRequest: &msgpb.DeleteRequest{Base: baseMsg, CollectionID: s.collectionID, PartitionID: 2, PrimaryKeys: storage.ParseInt64s2IDs(1), Timestamps: []uint64{10}}}, }}, } diff --git a/internal/querynodev2/pipeline/mock_data.go b/internal/querynodev2/pipeline/mock_data.go index a26b0d56603c7..f0090d9abc58c 100644 --- a/internal/querynodev2/pipeline/mock_data.go +++ b/internal/querynodev2/pipeline/mock_data.go @@ -53,7 +53,7 @@ func buildInsertMsg(collectionID int64, partitionID int64, segmentID int64, chan } func emptyDeleteMsg(collectionID int64, partitionID int64, channel string) *msgstream.DeleteMsg { - deleteReq := msgpb.DeleteRequest{ + deleteReq := &msgpb.DeleteRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Delete), commonpbutil.WithTimeStamp(0), @@ -70,7 +70,7 @@ func emptyDeleteMsg(collectionID int64, partitionID int64, channel string) *msgs } func emptyInsertMsg(collectionID int64, partitionID int64, segmentID int64, channel string) *msgstream.InsertMsg { - insertReq := msgpb.InsertRequest{ + insertReq := &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithTimeStamp(0), diff --git a/internal/querynodev2/segments/mock_data.go b/internal/querynodev2/segments/mock_data.go index 2e9d4f835565b..a8ba0ac6928ca 100644 --- a/internal/querynodev2/segments/mock_data.go +++ b/internal/querynodev2/segments/mock_data.go @@ -586,9 +586,12 @@ func genInsertData(msgLength int, schema *schemapb.CollectionSchema) (*storage.I Dim: dim, } case schemapb.DataType_SparseFloatVector: - sparseData := testutils.GenerateSparseFloatVectors(msgLength) + contents, dim := testutils.GenerateSparseFloatVectorsData(msgLength) insertData.Data[f.FieldID] = &storage.SparseFloatVectorFieldData{ - SparseFloatArray: *sparseData, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: contents, + Dim: dim, + }, } default: err := errors.New("data type not supported") @@ -694,9 +697,12 @@ func GenAndSaveIndexV2(collectionID, partitionID, segmentID, buildID int64, case schemapb.DataType_BFloat16Vector: dataset = indexcgowrapper.GenBFloat16VecDataset(testutils.GenerateBFloat16Vectors(msgLength, defaultDim)) case schemapb.DataType_SparseFloatVector: - data := testutils.GenerateSparseFloatVectors(msgLength) + contents, dim := testutils.GenerateSparseFloatVectorsData(msgLength) dataset = indexcgowrapper.GenSparseFloatVecDataset(&storage.SparseFloatVectorFieldData{ - SparseFloatArray: *data, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: contents, + Dim: dim, + }, }) } @@ -1110,7 +1116,7 @@ func genInsertMsg(collection *Collection, partitionID, segment int64, numRows in return &msgstream.InsertMsg{ BaseMsg: genMsgStreamBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: genCommonMsgBase(commonpb.MsgType_Insert, 0), CollectionName: "test-collection", PartitionName: "test-partition", diff --git a/internal/querynodev2/segments/segment.go b/internal/querynodev2/segments/segment.go index f1f033f5098f2..dd3ca8eb273f2 100644 --- a/internal/querynodev2/segments/segment.go +++ b/internal/querynodev2/segments/segment.go @@ -239,7 +239,7 @@ func (s *baseSegment) SetNeedUpdatedVersion(version int64) { } type FieldInfo struct { - datapb.FieldBinlog + *datapb.FieldBinlog RowCount int64 } @@ -426,7 +426,7 @@ func (s *LocalSegment) initializeSegment() error { }) if !typeutil.IsVectorType(field.GetDataType()) && !s.HasRawData(fieldID) { s.fields.Insert(fieldID, &FieldInfo{ - FieldBinlog: *info.FieldBinlog, + FieldBinlog: info.FieldBinlog, RowCount: loadInfo.GetNumOfRows(), }) } @@ -434,7 +434,7 @@ func (s *LocalSegment) initializeSegment() error { for _, binlogs := range fieldBinlogs { s.fields.Insert(binlogs.FieldID, &FieldInfo{ - FieldBinlog: *binlogs, + FieldBinlog: binlogs, RowCount: loadInfo.GetNumOfRows(), }) } diff --git a/internal/rootcoord/create_collection_task.go b/internal/rootcoord/create_collection_task.go index 2bafbebc878b5..4d55120538161 100644 --- a/internal/rootcoord/create_collection_task.go +++ b/internal/rootcoord/create_collection_task.go @@ -413,7 +413,7 @@ func (t *createCollectionTask) genCreateCollectionMsg(ctx context.Context, ts ui EndTimestamp: ts, HashValues: []uint32{0}, }, - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_CreateCollection), commonpbutil.WithTimeStamp(ts), diff --git a/internal/rootcoord/garbage_collector.go b/internal/rootcoord/garbage_collector.go index 523191da2274f..6657ca959269a 100644 --- a/internal/rootcoord/garbage_collector.go +++ b/internal/rootcoord/garbage_collector.go @@ -176,7 +176,7 @@ func (c *bgGarbageCollector) notifyCollectionGc(ctx context.Context, coll *model EndTimestamp: ts, HashValues: []uint32{0}, }, - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_DropCollection), commonpbutil.WithTimeStamp(ts), @@ -208,7 +208,7 @@ func (c *bgGarbageCollector) notifyPartitionGc(ctx context.Context, pChannels [] EndTimestamp: ts, HashValues: []uint32{0}, }, - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_DropPartition), commonpbutil.WithTimeStamp(ts), diff --git a/internal/rootcoord/timeticksync.go b/internal/rootcoord/timeticksync.go index 4ad56bc05911b..fee0c59ca1f8d 100644 --- a/internal/rootcoord/timeticksync.go +++ b/internal/rootcoord/timeticksync.go @@ -327,20 +327,20 @@ func (t *timetickSync) sendTimeTickToChannel(chanNames []string, ts typeutil.Tim }() msgPack := msgstream.MsgPack{} - timeTickResult := msgpb.TimeTickMsg{ - Base: commonpbutil.NewMsgBase( - commonpbutil.WithMsgType(commonpb.MsgType_TimeTick), - commonpbutil.WithTimeStamp(ts), - commonpbutil.WithSourceID(t.sourceID), - ), - } + timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: ts, EndTimestamp: ts, HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: commonpbutil.NewMsgBase( + commonpbutil.WithMsgType(commonpb.MsgType_TimeTick), + commonpbutil.WithTimeStamp(ts), + commonpbutil.WithSourceID(t.sourceID), + ), + }, } msgPack.Msgs = append(msgPack.Msgs, timeTickMsg) if err := t.dmlChannels.broadcast(chanNames, &msgPack); err != nil { diff --git a/internal/storage/data_codec_test.go b/internal/storage/data_codec_test.go index cbdec1414c589..c2dd57743b126 100644 --- a/internal/storage/data_codec_test.go +++ b/internal/storage/data_codec_test.go @@ -505,7 +505,7 @@ func TestInsertCodec(t *testing.T) { 0, 255, 0, 255, 0, 255, 0, 255, }, resultData.Data[BFloat16VectorField].(*BFloat16VectorFieldData).Data) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ // merged dim should be max of all dims Dim: 600, Contents: [][]byte{ @@ -516,7 +516,7 @@ func TestInsertCodec(t *testing.T) { typeutil.CreateSparseFloatRow([]uint32{10, 20, 30}, []float32{2.1, 2.2, 2.3}), typeutil.CreateSparseFloatRow([]uint32{100, 200, 599}, []float32{3.1, 3.2, 3.3}), }, - }, resultData.Data[SparseFloatVectorField].(*SparseFloatVectorFieldData).SparseFloatArray) + }, &resultData.Data[SparseFloatVectorField].(*SparseFloatVectorFieldData).SparseFloatArray) int32ArrayList := [][]int32{{1, 2, 3}, {4, 5, 6}, {3, 2, 1}, {6, 5, 4}} resultArrayList := [][]int32{} diff --git a/internal/storage/data_sorter_test.go b/internal/storage/data_sorter_test.go index e433967701ab7..1ca05285f9a50 100644 --- a/internal/storage/data_sorter_test.go +++ b/internal/storage/data_sorter_test.go @@ -270,14 +270,14 @@ func TestDataSorter(t *testing.T) { assert.Equal(t, []float32{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[109].(*FloatVectorFieldData).Data) assert.Equal(t, []byte{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[110].(*Float16VectorFieldData).Data) assert.Equal(t, []byte{16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, dataSorter.InsertData.Data[111].(*BFloat16VectorFieldData).Data) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ Dim: 600, Contents: [][]byte{ typeutil.CreateSparseFloatRow([]uint32{100, 200, 599}, []float32{3.1, 3.2, 3.3}), typeutil.CreateSparseFloatRow([]uint32{0, 1, 2}, []float32{1.1, 1.2, 1.3}), typeutil.CreateSparseFloatRow([]uint32{10, 20, 30}, []float32{2.1, 2.2, 2.3}), }, - }, dataSorter.InsertData.Data[112].(*SparseFloatVectorFieldData).SparseFloatArray) + }, &dataSorter.InsertData.Data[112].(*SparseFloatVectorFieldData).SparseFloatArray) } func TestDataSorter_Len(t *testing.T) { diff --git a/internal/storage/insert_data.go b/internal/storage/insert_data.go index 68d9c9c7e02ac..95fc96c5d97a7 100644 --- a/internal/storage/insert_data.go +++ b/internal/storage/insert_data.go @@ -20,11 +20,12 @@ import ( "encoding/binary" "fmt" + "google.golang.org/protobuf/proto" + "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/typeutil" - "google.golang.org/protobuf/proto" ) // TODO: fill it diff --git a/internal/storage/payload_test.go b/internal/storage/payload_test.go index 82dd64498a31f..b99b7b831347e 100644 --- a/internal/storage/payload_test.go +++ b/internal/storage/payload_test.go @@ -693,7 +693,7 @@ func TestPayload_ReaderAndWriter(t *testing.T) { assert.NoError(t, err) assert.Equal(t, 600, dim) assert.Equal(t, 6, len(floatVecs.Contents)) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ // merged dim should be max of all dims Dim: 600, Contents: [][]byte{ @@ -704,7 +704,7 @@ func TestPayload_ReaderAndWriter(t *testing.T) { typeutil.CreateSparseFloatRow([]uint32{60, 80, 230}, []float32{2.1, 2.2, 2.3}), typeutil.CreateSparseFloatRow([]uint32{170, 300, 579}, []float32{3.1, 3.2, 3.3}), }, - }, floatVecs.SparseFloatArray) + }, &floatVecs.SparseFloatArray) ifloatVecs, valids, dim, err := r.GetDataFromPayload() assert.NoError(t, err) @@ -747,10 +747,10 @@ func TestPayload_ReaderAndWriter(t *testing.T) { assert.NoError(t, err) assert.Equal(t, actualDim, dim) assert.Equal(t, 3, len(floatVecs.Contents)) - assert.Equal(t, schemapb.SparseFloatArray{ + assert.EqualExportedValues(t, &schemapb.SparseFloatArray{ Dim: int64(dim), Contents: rows, - }, floatVecs.SparseFloatArray) + }, &floatVecs.SparseFloatArray) ifloatVecs, valids, dim, err := r.GetDataFromPayload() assert.Nil(t, valids) diff --git a/internal/storage/utils_test.go b/internal/storage/utils_test.go index 4e969e78dab2b..57c7cebd6cfc2 100644 --- a/internal/storage/utils_test.go +++ b/internal/storage/utils_test.go @@ -658,7 +658,7 @@ func genRowBasedInsertMsg(numRows, fVecDim, bVecDim, f16VecDim, bf16VecDim int) HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -696,7 +696,7 @@ func genColumnBasedInsertMsg(schema *schemapb.CollectionSchema, numRows, fVecDim HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1066,7 +1066,7 @@ func TestRowBasedInsertMsgToInsertFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1109,7 +1109,7 @@ func TestRowBasedInsertMsgToInsertBFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1188,7 +1188,7 @@ func TestColumnBasedInsertMsgToInsertFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, @@ -1232,7 +1232,7 @@ func TestColumnBasedInsertMsgToInsertBFloat16VectorDataError(t *testing.T) { HashValues: nil, MsgPosition: nil, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 0, diff --git a/internal/streamingcoord/server/balancer/channel/pchannel.go b/internal/streamingcoord/server/balancer/channel/pchannel.go index 4add59bb9bba0..cd6a02c529db7 100644 --- a/internal/streamingcoord/server/balancer/channel/pchannel.go +++ b/internal/streamingcoord/server/balancer/channel/pchannel.go @@ -1,10 +1,11 @@ package channel import ( + "google.golang.org/protobuf/proto" + "github.com/milvus-io/milvus/internal/proto/streamingpb" "github.com/milvus-io/milvus/internal/util/streamingutil/typeconverter" "github.com/milvus-io/milvus/pkg/streaming/util/types" - "google.golang.org/protobuf/proto" ) // newPChannelMeta creates a new PChannelMeta. diff --git a/internal/util/flowgraph/node_test.go b/internal/util/flowgraph/node_test.go index 850fd183a267f..238e1f485f1a8 100644 --- a/internal/util/flowgraph/node_test.go +++ b/internal/util/flowgraph/node_test.go @@ -35,21 +35,20 @@ import ( func generateMsgPack() msgstream.MsgPack { msgPack := msgstream.MsgPack{} - timeTickResult := msgpb.TimeTickMsg{ - Base: &commonpb.MsgBase{ - MsgType: commonpb.MsgType_TimeTick, - MsgID: 0, - Timestamp: math.MaxUint64, - SourceID: 0, - }, - } timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ BeginTimestamp: uint64(time.Now().Unix()), EndTimestamp: uint64(time.Now().Unix() + 1), HashValues: []uint32{0}, }, - TimeTickMsg: timeTickResult, + TimeTickMsg: &msgpb.TimeTickMsg{ + Base: &commonpb.MsgBase{ + MsgType: commonpb.MsgType_TimeTick, + MsgID: 0, + Timestamp: math.MaxUint64, + SourceID: 0, + }, + }, } msgPack.Msgs = append(msgPack.Msgs, timeTickMsg) @@ -64,7 +63,7 @@ func generateInsertMsgPack() msgstream.MsgPack { EndTimestamp: uint64(time.Now().Unix() + 1), HashValues: []uint32{0}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert}, }, } diff --git a/internal/util/testutil/test_util.go b/internal/util/testutil/test_util.go index 4548f0e77ff31..698530b361b64 100644 --- a/internal/util/testutil/test_util.go +++ b/internal/util/testutil/test_util.go @@ -177,9 +177,12 @@ func CreateInsertData(schema *schemapb.CollectionSchema, rows int) (*storage.Ins Dim: int(dim), } case schemapb.DataType_SparseFloatVector: - sparseFloatVecData := testutils.GenerateSparseFloatVectors(rows) + data, dim := testutils.GenerateSparseFloatVectorsData(rows) insertData.Data[f.FieldID] = &storage.SparseFloatVectorFieldData{ - SparseFloatArray: *sparseFloatVecData, + SparseFloatArray: schemapb.SparseFloatArray{ + Contents: data, + Dim: dim, + }, } case schemapb.DataType_String, schemapb.DataType_VarChar: insertData.Data[f.FieldID] = &storage.StringFieldData{ diff --git a/pkg/go.mod b/pkg/go.mod index a192d811bd8e7..8a3fb201ffabc 100644 --- a/pkg/go.mod +++ b/pkg/go.mod @@ -18,7 +18,6 @@ require ( github.com/nats-io/nats-server/v2 v2.10.12 github.com/nats-io/nats.go v1.34.1 github.com/panjf2000/ants/v2 v2.7.2 - github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/remeh/sizedwaitgroup v1.0.0 @@ -30,7 +29,7 @@ require ( github.com/spf13/cast v1.3.1 github.com/spf13/viper v1.8.1 github.com/streamnative/pulsarctl v0.5.0 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c github.com/tikv/client-go/v2 v2.0.4 github.com/uber/jaeger-client-go v2.30.0+incompatible @@ -134,6 +133,7 @@ require ( github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 // indirect github.com/pingcap/kvproto v0.0.0-20221129023506-621ec37aac7a // indirect github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -147,7 +147,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stathat/consistent v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/tiancaiamao/gp v0.0.0-20221230034425-4025bc8a4d4a // indirect github.com/tikv/pd/client v0.0.0-20221031025758-80f0d8ca4d07 // indirect diff --git a/pkg/go.sum b/pkg/go.sum index 28e1892002cea..10ebb9c0c3489 100644 --- a/pkg/go.sum +++ b/pkg/go.sum @@ -713,8 +713,9 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -725,8 +726,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/thoas/go-funk v0.9.1 h1:O549iLZqPpTUQ10ykd26sZhzD+rmR5pWhuElrhbC20M= diff --git a/pkg/mq/msgdispatcher/mock_test.go b/pkg/mq/msgdispatcher/mock_test.go index 38b9cc21cc65a..a1be264befe77 100644 --- a/pkg/mq/msgdispatcher/mock_test.go +++ b/pkg/mq/msgdispatcher/mock_test.go @@ -110,7 +110,7 @@ func genInsertMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstr } return &msgstream.InsertMsg{ BaseMsg: msgstream.BaseMsg{HashValues: hashValues}, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Insert, MsgID: msgID}, ShardName: vchannel, Timestamps: genTimestamps(numRows), @@ -132,7 +132,7 @@ func genInsertMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstr func genDeleteMsg(numRows int, vchannel string, msgID typeutil.UniqueID) *msgstream.DeleteMsg { return &msgstream.DeleteMsg{ BaseMsg: msgstream.BaseMsg{HashValues: make([]uint32, numRows)}, - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_Delete, MsgID: msgID}, ShardName: vchannel, PrimaryKeys: &schemapb.IDs{ @@ -153,28 +153,28 @@ func genDDLMsg(msgType commonpb.MsgType) msgstream.TsMsg { case commonpb.MsgType_CreateCollection: return &msgstream.CreateCollectionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_CreateCollection}, }, } case commonpb.MsgType_DropCollection: return &msgstream.DropCollectionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropCollection}, }, } case commonpb.MsgType_CreatePartition: return &msgstream.CreatePartitionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - CreatePartitionRequest: msgpb.CreatePartitionRequest{ + CreatePartitionRequest: &msgpb.CreatePartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_CreatePartition}, }, } case commonpb.MsgType_DropPartition: return &msgstream.DropPartitionMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{MsgType: commonpb.MsgType_DropPartition}, }, } @@ -185,7 +185,7 @@ func genDDLMsg(msgType commonpb.MsgType) msgstream.TsMsg { func genTimeTickMsg(ts typeutil.Timestamp) *msgstream.TimeTickMsg { return &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{HashValues: []uint32{0}}, - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, Timestamp: ts, diff --git a/pkg/mq/msgstream/factory_stream_test.go b/pkg/mq/msgstream/factory_stream_test.go index 0cf5fcbd7acdb..38803e9723cbe 100644 --- a/pkg/mq/msgstream/factory_stream_test.go +++ b/pkg/mq/msgstream/factory_stream_test.go @@ -90,7 +90,7 @@ func testInsertWithRepack(t *testing.T, f []Factory) { } func testInsertRepackFuncWithDifferentClient(t *testing.T, f []Factory) { - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -119,7 +119,7 @@ func testInsertRepackFuncWithDifferentClient(t *testing.T, f []Factory) { } func testDeleteRepackFuncWithDifferentClient(t *testing.T, f []Factory) { - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, diff --git a/pkg/mq/msgstream/mq_msgstream_test.go b/pkg/mq/msgstream/mq_msgstream_test.go index 3bf6e6a0b3548..1fbefef9e160f 100644 --- a/pkg/mq/msgstream/mq_msgstream_test.go +++ b/pkg/mq/msgstream/mq_msgstream_test.go @@ -245,7 +245,7 @@ func TestStream_PulsarMsgStream_InsertRepackFunc(t *testing.T) { consumerChannels := []string{c1, c2} consumerSubName := funcutil.RandomString(8) - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -299,7 +299,7 @@ func TestStream_PulsarMsgStream_DeleteRepackFunc(t *testing.T) { consumerChannels := []string{c1, c2} consumerSubName := funcutil.RandomString(8) - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, @@ -1251,7 +1251,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { time := uint64(reqID) switch msgType { case commonpb.MsgType_Insert: - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: reqID, @@ -1276,7 +1276,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return insertMsg case commonpb.MsgType_Delete: - deleteRequest := msgpb.DeleteRequest{ + deleteRequest := &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: reqID, @@ -1299,7 +1299,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return deleteMsg case commonpb.MsgType_CreateCollection: - createCollectionRequest := msgpb.CreateCollectionRequest{ + createCollectionRequest := &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateCollection, MsgID: reqID, @@ -1326,7 +1326,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { } return createCollectionMsg case commonpb.MsgType_TimeTick: - timeTickResult := msgpb.TimeTickMsg{ + timeTickResult := &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, @@ -1350,7 +1350,7 @@ func getTsMsg(msgType MsgType, reqID UniqueID) TsMsg { func getTimeTickMsg(reqID UniqueID) TsMsg { hashValue := uint32(reqID) time := uint64(reqID) - timeTickResult := msgpb.TimeTickMsg{ + timeTickResult := &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: reqID, @@ -1399,7 +1399,7 @@ func getInsertMsgUniqueID(ts UniqueID) TsMsg { hashValue := uint32(ts) time := uint64(ts) - insertRequest := msgpb.InsertRequest{ + insertRequest := &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: idCounter.Inc(), diff --git a/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go b/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go index b3de2b1895bcc..73f3f069b491a 100644 --- a/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go +++ b/pkg/mq/msgstream/mq_rocksmq_msgstream_test.go @@ -84,7 +84,7 @@ func TestMqMsgStream_ComputeProduceChannelIndexes(t *testing.T) { // not called AsProducer yet insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -137,7 +137,7 @@ func TestMqMsgStream_Produce(t *testing.T) { // Produce before called AsProducer insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, diff --git a/pkg/mq/msgstream/msg.go b/pkg/mq/msgstream/msg.go index c064847e54cf6..bf5ddd29537c2 100644 --- a/pkg/mq/msgstream/msg.go +++ b/pkg/mq/msgstream/msg.go @@ -131,7 +131,7 @@ func convertToByteArray(input interface{}) ([]byte, error) { // InsertMsg is a message pack that contains insert request type InsertMsg struct { BaseMsg - msgpb.InsertRequest + *msgpb.InsertRequest } // interface implementation validation @@ -160,7 +160,7 @@ func (it *InsertMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *InsertMsg) Marshal(input TsMsg) (MarshalType, error) { insertMsg := input.(*InsertMsg) - insertRequest := &insertMsg.InsertRequest + insertRequest := insertMsg.InsertRequest mb, err := proto.Marshal(insertRequest) if err != nil { return nil, err @@ -170,12 +170,12 @@ func (it *InsertMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *InsertMsg) Unmarshal(input MarshalType) (TsMsg, error) { - insertRequest := msgpb.InsertRequest{} + insertRequest := &msgpb.InsertRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &insertRequest) + err = proto.Unmarshal(in, insertRequest) if err != nil { return nil, err } @@ -240,8 +240,8 @@ func (it *InsertMsg) CheckAligned() error { return nil } -func (it *InsertMsg) rowBasedIndexRequest(index int) msgpb.InsertRequest { - return msgpb.InsertRequest{ +func (it *InsertMsg) rowBasedIndexRequest(index int) *msgpb.InsertRequest { + return &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithMsgID(it.Base.MsgID), @@ -262,11 +262,11 @@ func (it *InsertMsg) rowBasedIndexRequest(index int) msgpb.InsertRequest { } } -func (it *InsertMsg) columnBasedIndexRequest(index int) msgpb.InsertRequest { +func (it *InsertMsg) columnBasedIndexRequest(index int) *msgpb.InsertRequest { colNum := len(it.GetFieldsData()) fieldsData := make([]*schemapb.FieldData, colNum) typeutil.AppendFieldData(fieldsData, it.GetFieldsData(), int64(index)) - return msgpb.InsertRequest{ + return &msgpb.InsertRequest{ Base: commonpbutil.NewMsgBase( commonpbutil.WithMsgType(commonpb.MsgType_Insert), commonpbutil.WithMsgID(it.Base.MsgID), @@ -288,7 +288,7 @@ func (it *InsertMsg) columnBasedIndexRequest(index int) msgpb.InsertRequest { } } -func (it *InsertMsg) IndexRequest(index int) msgpb.InsertRequest { +func (it *InsertMsg) IndexRequest(index int) *msgpb.InsertRequest { if it.IsRowBased() { return it.rowBasedIndexRequest(index) } @@ -309,7 +309,7 @@ func (it *InsertMsg) IndexMsg(index int) *InsertMsg { } func (it *InsertMsg) Size() int { - return proto.Size(&it.InsertRequest) + return proto.Size(it.InsertRequest) } /////////////////////////////////////////Delete////////////////////////////////////////// @@ -317,7 +317,7 @@ func (it *InsertMsg) Size() int { // DeleteMsg is a message pack that contains delete request type DeleteMsg struct { BaseMsg - msgpb.DeleteRequest + *msgpb.DeleteRequest } // interface implementation validation @@ -346,7 +346,7 @@ func (dt *DeleteMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dt *DeleteMsg) Marshal(input TsMsg) (MarshalType, error) { deleteMsg := input.(*DeleteMsg) - deleteRequest := &deleteMsg.DeleteRequest + deleteRequest := deleteMsg.DeleteRequest mb, err := proto.Marshal(deleteRequest) if err != nil { return nil, err @@ -357,12 +357,12 @@ func (dt *DeleteMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dt *DeleteMsg) Unmarshal(input MarshalType) (TsMsg, error) { - deleteRequest := msgpb.DeleteRequest{} + deleteRequest := &msgpb.DeleteRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &deleteRequest) + err = proto.Unmarshal(in, deleteRequest) if err != nil { return nil, err } @@ -412,7 +412,7 @@ func (dt *DeleteMsg) CheckAligned() error { } func (dt *DeleteMsg) Size() int { - return proto.Size(&dt.DeleteRequest) + return proto.Size(dt.DeleteRequest) } // ///////////////////////////////////////Upsert////////////////////////////////////////// @@ -426,7 +426,7 @@ type UpsertMsg struct { // TimeTickMsg is a message pack that contains time tick only type TimeTickMsg struct { BaseMsg - msgpb.TimeTickMsg + *msgpb.TimeTickMsg } // interface implementation validation @@ -455,7 +455,7 @@ func (tst *TimeTickMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (tst *TimeTickMsg) Marshal(input TsMsg) (MarshalType, error) { timeTickTask := input.(*TimeTickMsg) - timeTick := &timeTickTask.TimeTickMsg + timeTick := timeTickTask.TimeTickMsg mb, err := proto.Marshal(timeTick) if err != nil { return nil, err @@ -465,12 +465,12 @@ func (tst *TimeTickMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (tst *TimeTickMsg) Unmarshal(input MarshalType) (TsMsg, error) { - timeTickMsg := msgpb.TimeTickMsg{} + timeTickMsg := &msgpb.TimeTickMsg{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &timeTickMsg) + err = proto.Unmarshal(in, timeTickMsg) if err != nil { return nil, err } @@ -482,7 +482,7 @@ func (tst *TimeTickMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (tst *TimeTickMsg) Size() int { - return proto.Size(&tst.TimeTickMsg) + return proto.Size(tst.TimeTickMsg) } /////////////////////////////////////////CreateCollection////////////////////////////////////////// @@ -490,7 +490,7 @@ func (tst *TimeTickMsg) Size() int { // CreateCollectionMsg is a message pack that contains create collection request type CreateCollectionMsg struct { BaseMsg - msgpb.CreateCollectionRequest + *msgpb.CreateCollectionRequest } // interface implementation validation @@ -519,7 +519,7 @@ func (cc *CreateCollectionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (cc *CreateCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { createCollectionMsg := input.(*CreateCollectionMsg) - createCollectionRequest := &createCollectionMsg.CreateCollectionRequest + createCollectionRequest := createCollectionMsg.CreateCollectionRequest mb, err := proto.Marshal(createCollectionRequest) if err != nil { return nil, err @@ -529,12 +529,12 @@ func (cc *CreateCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (cc *CreateCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createCollectionRequest := msgpb.CreateCollectionRequest{} + createCollectionRequest := &msgpb.CreateCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createCollectionRequest) + err = proto.Unmarshal(in, createCollectionRequest) if err != nil { return nil, err } @@ -546,7 +546,7 @@ func (cc *CreateCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (cc *CreateCollectionMsg) Size() int { - return proto.Size(&cc.CreateCollectionRequest) + return proto.Size(cc.CreateCollectionRequest) } /////////////////////////////////////////DropCollection////////////////////////////////////////// @@ -554,7 +554,7 @@ func (cc *CreateCollectionMsg) Size() int { // DropCollectionMsg is a message pack that contains drop collection request type DropCollectionMsg struct { BaseMsg - msgpb.DropCollectionRequest + *msgpb.DropCollectionRequest } // interface implementation validation @@ -583,7 +583,7 @@ func (dc *DropCollectionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dc *DropCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { dropCollectionMsg := input.(*DropCollectionMsg) - dropCollectionRequest := &dropCollectionMsg.DropCollectionRequest + dropCollectionRequest := dropCollectionMsg.DropCollectionRequest mb, err := proto.Marshal(dropCollectionRequest) if err != nil { return nil, err @@ -593,12 +593,12 @@ func (dc *DropCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dc *DropCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropCollectionRequest := msgpb.DropCollectionRequest{} + dropCollectionRequest := &msgpb.DropCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropCollectionRequest) + err = proto.Unmarshal(in, dropCollectionRequest) if err != nil { return nil, err } @@ -610,7 +610,7 @@ func (dc *DropCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (dc *DropCollectionMsg) Size() int { - return proto.Size(&dc.DropCollectionRequest) + return proto.Size(dc.DropCollectionRequest) } /////////////////////////////////////////CreatePartition////////////////////////////////////////// @@ -618,7 +618,7 @@ func (dc *DropCollectionMsg) Size() int { // CreatePartitionMsg is a message pack that contains create partition request type CreatePartitionMsg struct { BaseMsg - msgpb.CreatePartitionRequest + *msgpb.CreatePartitionRequest } // interface implementation validation @@ -647,7 +647,7 @@ func (cp *CreatePartitionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (cp *CreatePartitionMsg) Marshal(input TsMsg) (MarshalType, error) { createPartitionMsg := input.(*CreatePartitionMsg) - createPartitionRequest := &createPartitionMsg.CreatePartitionRequest + createPartitionRequest := createPartitionMsg.CreatePartitionRequest mb, err := proto.Marshal(createPartitionRequest) if err != nil { return nil, err @@ -657,12 +657,12 @@ func (cp *CreatePartitionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (cp *CreatePartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createPartitionRequest := msgpb.CreatePartitionRequest{} + createPartitionRequest := &msgpb.CreatePartitionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createPartitionRequest) + err = proto.Unmarshal(in, createPartitionRequest) if err != nil { return nil, err } @@ -674,7 +674,7 @@ func (cp *CreatePartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (cp *CreatePartitionMsg) Size() int { - return proto.Size(&cp.CreatePartitionRequest) + return proto.Size(cp.CreatePartitionRequest) } /////////////////////////////////////////DropPartition////////////////////////////////////////// @@ -682,7 +682,7 @@ func (cp *CreatePartitionMsg) Size() int { // DropPartitionMsg is a message pack that contains drop partition request type DropPartitionMsg struct { BaseMsg - msgpb.DropPartitionRequest + *msgpb.DropPartitionRequest } // interface implementation validation @@ -711,7 +711,7 @@ func (dp *DropPartitionMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (dp *DropPartitionMsg) Marshal(input TsMsg) (MarshalType, error) { dropPartitionMsg := input.(*DropPartitionMsg) - dropPartitionRequest := &dropPartitionMsg.DropPartitionRequest + dropPartitionRequest := dropPartitionMsg.DropPartitionRequest mb, err := proto.Marshal(dropPartitionRequest) if err != nil { return nil, err @@ -721,12 +721,12 @@ func (dp *DropPartitionMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (dp *DropPartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropPartitionRequest := msgpb.DropPartitionRequest{} + dropPartitionRequest := &msgpb.DropPartitionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropPartitionRequest) + err = proto.Unmarshal(in, dropPartitionRequest) if err != nil { return nil, err } @@ -738,7 +738,7 @@ func (dp *DropPartitionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (dp *DropPartitionMsg) Size() int { - return proto.Size(&dp.DropPartitionRequest) + return proto.Size(dp.DropPartitionRequest) } /////////////////////////////////////////DataNodeTtMsg////////////////////////////////////////// @@ -746,7 +746,7 @@ func (dp *DropPartitionMsg) Size() int { // DataNodeTtMsg is a message pack that contains datanode time tick type DataNodeTtMsg struct { BaseMsg - msgpb.DataNodeTtMsg + *msgpb.DataNodeTtMsg } // interface implementation validation @@ -775,7 +775,7 @@ func (m *DataNodeTtMsg) SourceID() int64 { // Marshal is used to serializing a message pack to byte array func (m *DataNodeTtMsg) Marshal(input TsMsg) (MarshalType, error) { msg := input.(*DataNodeTtMsg) - t, err := proto.Marshal(&msg.DataNodeTtMsg) + t, err := proto.Marshal(msg.DataNodeTtMsg) if err != nil { return nil, err } @@ -784,12 +784,12 @@ func (m *DataNodeTtMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserializing a message pack from byte array func (m *DataNodeTtMsg) Unmarshal(input MarshalType) (TsMsg, error) { - msg := msgpb.DataNodeTtMsg{} + msg := &msgpb.DataNodeTtMsg{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &msg) + err = proto.Unmarshal(in, msg) if err != nil { return nil, err } @@ -799,5 +799,5 @@ func (m *DataNodeTtMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (m *DataNodeTtMsg) Size() int { - return proto.Size(&m.DataNodeTtMsg) + return proto.Size(m.DataNodeTtMsg) } diff --git a/pkg/mq/msgstream/msg_for_collection.go b/pkg/mq/msgstream/msg_for_collection.go index cd87c4dfc3bdb..ae08317fe7173 100644 --- a/pkg/mq/msgstream/msg_for_collection.go +++ b/pkg/mq/msgstream/msg_for_collection.go @@ -27,7 +27,7 @@ import ( // LoadCollectionMsg is a message pack that contains load collection request type LoadCollectionMsg struct { BaseMsg - milvuspb.LoadCollectionRequest + *milvuspb.LoadCollectionRequest } // interface implementation validation @@ -51,7 +51,7 @@ func (l *LoadCollectionMsg) SourceID() int64 { func (l *LoadCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { loadCollectionMsg := input.(*LoadCollectionMsg) - loadCollectionRequest := &loadCollectionMsg.LoadCollectionRequest + loadCollectionRequest := loadCollectionMsg.LoadCollectionRequest mb, err := proto.Marshal(loadCollectionRequest) if err != nil { return nil, err @@ -60,12 +60,12 @@ func (l *LoadCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { } func (l *LoadCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - loadCollectionRequest := milvuspb.LoadCollectionRequest{} + loadCollectionRequest := &milvuspb.LoadCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &loadCollectionRequest) + err = proto.Unmarshal(in, loadCollectionRequest) if err != nil { return nil, err } @@ -77,13 +77,13 @@ func (l *LoadCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (l *LoadCollectionMsg) Size() int { - return proto.Size(&l.LoadCollectionRequest) + return proto.Size(l.LoadCollectionRequest) } // ReleaseCollectionMsg is a message pack that contains release collection request type ReleaseCollectionMsg struct { BaseMsg - milvuspb.ReleaseCollectionRequest + *milvuspb.ReleaseCollectionRequest } var _ TsMsg = &ReleaseCollectionMsg{} @@ -106,7 +106,7 @@ func (r *ReleaseCollectionMsg) SourceID() int64 { func (r *ReleaseCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { releaseCollectionMsg := input.(*ReleaseCollectionMsg) - releaseCollectionRequest := &releaseCollectionMsg.ReleaseCollectionRequest + releaseCollectionRequest := releaseCollectionMsg.ReleaseCollectionRequest mb, err := proto.Marshal(releaseCollectionRequest) if err != nil { return nil, err @@ -115,12 +115,12 @@ func (r *ReleaseCollectionMsg) Marshal(input TsMsg) (MarshalType, error) { } func (r *ReleaseCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { - releaseCollectionRequest := milvuspb.ReleaseCollectionRequest{} + releaseCollectionRequest := &milvuspb.ReleaseCollectionRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &releaseCollectionRequest) + err = proto.Unmarshal(in, releaseCollectionRequest) if err != nil { return nil, err } @@ -132,12 +132,12 @@ func (r *ReleaseCollectionMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (r *ReleaseCollectionMsg) Size() int { - return proto.Size(&r.ReleaseCollectionRequest) + return proto.Size(r.ReleaseCollectionRequest) } type FlushMsg struct { BaseMsg - milvuspb.FlushRequest + *milvuspb.FlushRequest } var _ TsMsg = &FlushMsg{} @@ -160,7 +160,7 @@ func (f *FlushMsg) SourceID() int64 { func (f *FlushMsg) Marshal(input TsMsg) (MarshalType, error) { flushMsg := input.(*FlushMsg) - flushRequest := &flushMsg.FlushRequest + flushRequest := flushMsg.FlushRequest mb, err := proto.Marshal(flushRequest) if err != nil { return nil, err @@ -169,12 +169,12 @@ func (f *FlushMsg) Marshal(input TsMsg) (MarshalType, error) { } func (f *FlushMsg) Unmarshal(input MarshalType) (TsMsg, error) { - flushRequest := milvuspb.FlushRequest{} + flushRequest := &milvuspb.FlushRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &flushRequest) + err = proto.Unmarshal(in, flushRequest) if err != nil { return nil, err } @@ -186,5 +186,5 @@ func (f *FlushMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (f *FlushMsg) Size() int { - return proto.Size(&f.FlushRequest) + return proto.Size(f.FlushRequest) } diff --git a/pkg/mq/msgstream/msg_for_collection_test.go b/pkg/mq/msgstream/msg_for_collection_test.go index f84f17fefd408..665baa0d0ad07 100644 --- a/pkg/mq/msgstream/msg_for_collection_test.go +++ b/pkg/mq/msgstream/msg_for_collection_test.go @@ -29,7 +29,7 @@ import ( func TestFlushMsg(t *testing.T) { var msg TsMsg = &FlushMsg{ - FlushRequest: milvuspb.FlushRequest{ + FlushRequest: &milvuspb.FlushRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Flush, MsgID: 100, @@ -68,7 +68,7 @@ func TestFlushMsg(t *testing.T) { func TestLoadCollection(t *testing.T) { var msg TsMsg = &LoadCollectionMsg{ - LoadCollectionRequest: milvuspb.LoadCollectionRequest{ + LoadCollectionRequest: &milvuspb.LoadCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_LoadCollection, MsgID: 100, @@ -107,7 +107,7 @@ func TestLoadCollection(t *testing.T) { func TestReleaseCollection(t *testing.T) { var msg TsMsg = &ReleaseCollectionMsg{ - ReleaseCollectionRequest: milvuspb.ReleaseCollectionRequest{ + ReleaseCollectionRequest: &milvuspb.ReleaseCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_ReleaseCollection, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_database.go b/pkg/mq/msgstream/msg_for_database.go index 584ce72edee2c..c094ef76cd03f 100644 --- a/pkg/mq/msgstream/msg_for_database.go +++ b/pkg/mq/msgstream/msg_for_database.go @@ -26,7 +26,7 @@ import ( type CreateDatabaseMsg struct { BaseMsg - milvuspb.CreateDatabaseRequest + *milvuspb.CreateDatabaseRequest } var _ TsMsg = &CreateDatabaseMsg{} @@ -49,7 +49,7 @@ func (c *CreateDatabaseMsg) SourceID() int64 { func (c *CreateDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { createDataBaseMsg := input.(*CreateDatabaseMsg) - createDatabaseRequest := &createDataBaseMsg.CreateDatabaseRequest + createDatabaseRequest := createDataBaseMsg.CreateDatabaseRequest mb, err := proto.Marshal(createDatabaseRequest) if err != nil { return nil, err @@ -58,12 +58,12 @@ func (c *CreateDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { } func (c *CreateDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createDatabaseRequest := milvuspb.CreateDatabaseRequest{} + createDatabaseRequest := &milvuspb.CreateDatabaseRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createDatabaseRequest) + err = proto.Unmarshal(in, createDatabaseRequest) if err != nil { return nil, err } @@ -75,12 +75,12 @@ func (c *CreateDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (c *CreateDatabaseMsg) Size() int { - return proto.Size(&c.CreateDatabaseRequest) + return proto.Size(c.CreateDatabaseRequest) } type DropDatabaseMsg struct { BaseMsg - milvuspb.DropDatabaseRequest + *milvuspb.DropDatabaseRequest } var _ TsMsg = &DropDatabaseMsg{} @@ -103,7 +103,7 @@ func (d *DropDatabaseMsg) SourceID() int64 { func (d *DropDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { dropDataBaseMsg := input.(*DropDatabaseMsg) - dropDatabaseRequest := &dropDataBaseMsg.DropDatabaseRequest + dropDatabaseRequest := dropDataBaseMsg.DropDatabaseRequest mb, err := proto.Marshal(dropDatabaseRequest) if err != nil { return nil, err @@ -112,12 +112,12 @@ func (d *DropDatabaseMsg) Marshal(input TsMsg) (MarshalType, error) { } func (d *DropDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropDatabaseRequest := milvuspb.DropDatabaseRequest{} + dropDatabaseRequest := &milvuspb.DropDatabaseRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropDatabaseRequest) + err = proto.Unmarshal(in, dropDatabaseRequest) if err != nil { return nil, err } @@ -129,5 +129,5 @@ func (d *DropDatabaseMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (d *DropDatabaseMsg) Size() int { - return proto.Size(&d.DropDatabaseRequest) + return proto.Size(d.DropDatabaseRequest) } diff --git a/pkg/mq/msgstream/msg_for_database_test.go b/pkg/mq/msgstream/msg_for_database_test.go index e3d9579599fb6..941b96ed8a5b8 100644 --- a/pkg/mq/msgstream/msg_for_database_test.go +++ b/pkg/mq/msgstream/msg_for_database_test.go @@ -29,7 +29,7 @@ import ( func TestCreateDatabase(t *testing.T) { var msg TsMsg = &CreateDatabaseMsg{ - CreateDatabaseRequest: milvuspb.CreateDatabaseRequest{ + CreateDatabaseRequest: &milvuspb.CreateDatabaseRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateDatabase, MsgID: 100, @@ -66,7 +66,7 @@ func TestCreateDatabase(t *testing.T) { func TestDropDatabase(t *testing.T) { var msg TsMsg = &DropDatabaseMsg{ - DropDatabaseRequest: milvuspb.DropDatabaseRequest{ + DropDatabaseRequest: &milvuspb.DropDatabaseRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropDatabase, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_index.go b/pkg/mq/msgstream/msg_for_index.go index 6de6b910181ae..3c2cc62f930d6 100644 --- a/pkg/mq/msgstream/msg_for_index.go +++ b/pkg/mq/msgstream/msg_for_index.go @@ -27,7 +27,7 @@ import ( // CreateIndexMsg is a message pack that contains create index request type CreateIndexMsg struct { BaseMsg - milvuspb.CreateIndexRequest + *milvuspb.CreateIndexRequest } // interface implementation validation @@ -56,7 +56,7 @@ func (it *CreateIndexMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *CreateIndexMsg) Marshal(input TsMsg) (MarshalType, error) { createIndexMsg := input.(*CreateIndexMsg) - createIndexRequest := &createIndexMsg.CreateIndexRequest + createIndexRequest := createIndexMsg.CreateIndexRequest mb, err := proto.Marshal(createIndexRequest) if err != nil { return nil, err @@ -66,12 +66,12 @@ func (it *CreateIndexMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *CreateIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - createIndexRequest := milvuspb.CreateIndexRequest{} + createIndexRequest := &milvuspb.CreateIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &createIndexRequest) + err = proto.Unmarshal(in, createIndexRequest) if err != nil { return nil, err } @@ -83,13 +83,13 @@ func (it *CreateIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (it *CreateIndexMsg) Size() int { - return proto.Size(&it.CreateIndexRequest) + return proto.Size(it.CreateIndexRequest) } // AlterIndexMsg is a message pack that contains create index request type AlterIndexMsg struct { BaseMsg - milvuspb.AlterIndexRequest + *milvuspb.AlterIndexRequest } // interface implementation validation @@ -118,7 +118,7 @@ func (it *AlterIndexMsg) SourceID() int64 { // Marshal is used to serialize a message pack to byte array func (it *AlterIndexMsg) Marshal(input TsMsg) (MarshalType, error) { AlterIndexMsg := input.(*AlterIndexMsg) - AlterIndexRequest := &AlterIndexMsg.AlterIndexRequest + AlterIndexRequest := AlterIndexMsg.AlterIndexRequest mb, err := proto.Marshal(AlterIndexRequest) if err != nil { return nil, err @@ -128,12 +128,12 @@ func (it *AlterIndexMsg) Marshal(input TsMsg) (MarshalType, error) { // Unmarshal is used to deserialize a message pack from byte array func (it *AlterIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - alterIndexRequest := milvuspb.AlterIndexRequest{} + alterIndexRequest := &milvuspb.AlterIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &alterIndexRequest) + err = proto.Unmarshal(in, alterIndexRequest) if err != nil { return nil, err } @@ -145,13 +145,13 @@ func (it *AlterIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (it *AlterIndexMsg) Size() int { - return proto.Size(&it.AlterIndexRequest) + return proto.Size(it.AlterIndexRequest) } // DropIndexMsg is a message pack that contains drop index request type DropIndexMsg struct { BaseMsg - milvuspb.DropIndexRequest + *milvuspb.DropIndexRequest } var _ TsMsg = &DropIndexMsg{} @@ -174,7 +174,7 @@ func (d *DropIndexMsg) SourceID() int64 { func (d *DropIndexMsg) Marshal(input TsMsg) (MarshalType, error) { dropIndexMsg := input.(*DropIndexMsg) - dropIndexRequest := &dropIndexMsg.DropIndexRequest + dropIndexRequest := dropIndexMsg.DropIndexRequest mb, err := proto.Marshal(dropIndexRequest) if err != nil { return nil, err @@ -183,12 +183,12 @@ func (d *DropIndexMsg) Marshal(input TsMsg) (MarshalType, error) { } func (d *DropIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { - dropIndexRequest := milvuspb.DropIndexRequest{} + dropIndexRequest := &milvuspb.DropIndexRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &dropIndexRequest) + err = proto.Unmarshal(in, dropIndexRequest) if err != nil { return nil, err } @@ -200,5 +200,5 @@ func (d *DropIndexMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (d *DropIndexMsg) Size() int { - return proto.Size(&d.DropIndexRequest) + return proto.Size(d.DropIndexRequest) } diff --git a/pkg/mq/msgstream/msg_for_index_test.go b/pkg/mq/msgstream/msg_for_index_test.go index 590231c16380e..bbbf64f650956 100644 --- a/pkg/mq/msgstream/msg_for_index_test.go +++ b/pkg/mq/msgstream/msg_for_index_test.go @@ -29,7 +29,7 @@ import ( func TestCreateIndex(t *testing.T) { var msg TsMsg = &CreateIndexMsg{ - CreateIndexRequest: milvuspb.CreateIndexRequest{ + CreateIndexRequest: &milvuspb.CreateIndexRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateIndex, MsgID: 100, @@ -65,7 +65,7 @@ func TestCreateIndex(t *testing.T) { func TestDropIndex(t *testing.T) { var msg TsMsg = &DropIndexMsg{ - DropIndexRequest: milvuspb.DropIndexRequest{ + DropIndexRequest: &milvuspb.DropIndexRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropIndex, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_for_partition.go b/pkg/mq/msgstream/msg_for_partition.go index b92a9d8ded876..d600ba854febf 100644 --- a/pkg/mq/msgstream/msg_for_partition.go +++ b/pkg/mq/msgstream/msg_for_partition.go @@ -26,7 +26,7 @@ import ( type LoadPartitionsMsg struct { BaseMsg - milvuspb.LoadPartitionsRequest + *milvuspb.LoadPartitionsRequest } var _ TsMsg = &LoadPartitionsMsg{} @@ -49,7 +49,7 @@ func (l *LoadPartitionsMsg) SourceID() int64 { func (l *LoadPartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { loadPartitionsMsg := input.(*LoadPartitionsMsg) - loadPartitionsRequest := &loadPartitionsMsg.LoadPartitionsRequest + loadPartitionsRequest := loadPartitionsMsg.LoadPartitionsRequest mb, err := proto.Marshal(loadPartitionsRequest) if err != nil { return nil, err @@ -58,12 +58,12 @@ func (l *LoadPartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { } func (l *LoadPartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { - loadPartitionsRequest := milvuspb.LoadPartitionsRequest{} + loadPartitionsRequest := &milvuspb.LoadPartitionsRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &loadPartitionsRequest) + err = proto.Unmarshal(in, loadPartitionsRequest) if err != nil { return nil, err } @@ -75,12 +75,12 @@ func (l *LoadPartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (l *LoadPartitionsMsg) Size() int { - return proto.Size(&l.LoadPartitionsRequest) + return proto.Size(l.LoadPartitionsRequest) } type ReleasePartitionsMsg struct { BaseMsg - milvuspb.ReleasePartitionsRequest + *milvuspb.ReleasePartitionsRequest } var _ TsMsg = &ReleasePartitionsMsg{} @@ -103,7 +103,7 @@ func (r *ReleasePartitionsMsg) SourceID() int64 { func (r *ReleasePartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { releasePartitionsMsg := input.(*ReleasePartitionsMsg) - releasePartitionsRequest := &releasePartitionsMsg.ReleasePartitionsRequest + releasePartitionsRequest := releasePartitionsMsg.ReleasePartitionsRequest mb, err := proto.Marshal(releasePartitionsRequest) if err != nil { return nil, err @@ -112,12 +112,12 @@ func (r *ReleasePartitionsMsg) Marshal(input TsMsg) (MarshalType, error) { } func (r *ReleasePartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { - releasePartitionsRequest := milvuspb.ReleasePartitionsRequest{} + releasePartitionsRequest := &milvuspb.ReleasePartitionsRequest{} in, err := convertToByteArray(input) if err != nil { return nil, err } - err = proto.Unmarshal(in, &releasePartitionsRequest) + err = proto.Unmarshal(in, releasePartitionsRequest) if err != nil { return nil, err } @@ -128,5 +128,5 @@ func (r *ReleasePartitionsMsg) Unmarshal(input MarshalType) (TsMsg, error) { } func (r *ReleasePartitionsMsg) Size() int { - return proto.Size(&r.ReleasePartitionsRequest) + return proto.Size(r.ReleasePartitionsRequest) } diff --git a/pkg/mq/msgstream/msg_for_partition_test.go b/pkg/mq/msgstream/msg_for_partition_test.go index 981be41bc6c3a..caed9a9b92d67 100644 --- a/pkg/mq/msgstream/msg_for_partition_test.go +++ b/pkg/mq/msgstream/msg_for_partition_test.go @@ -29,7 +29,7 @@ import ( func TestLoadPartitions(t *testing.T) { msg := &LoadPartitionsMsg{ - LoadPartitionsRequest: milvuspb.LoadPartitionsRequest{ + LoadPartitionsRequest: &milvuspb.LoadPartitionsRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_LoadPartitions, MsgID: 100, @@ -74,7 +74,7 @@ func TestLoadPartitions(t *testing.T) { func TestReleasePartitions(t *testing.T) { msg := &ReleasePartitionsMsg{ - ReleasePartitionsRequest: milvuspb.ReleasePartitionsRequest{ + ReleasePartitionsRequest: &milvuspb.ReleasePartitionsRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_ReleasePartitions, MsgID: 100, diff --git a/pkg/mq/msgstream/msg_test.go b/pkg/mq/msgstream/msg_test.go index 20e7b4c81c1e7..67e3a9286c22a 100644 --- a/pkg/mq/msgstream/msg_test.go +++ b/pkg/mq/msgstream/msg_test.go @@ -83,7 +83,7 @@ func generateBaseMsg() BaseMsg { func TestInsertMsg(t *testing.T) { insertMsg := &InsertMsg{ BaseMsg: generateBaseMsg(), - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, @@ -136,7 +136,7 @@ func TestInsertMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestInsertMsg_RowBasedFormat(t *testing.T) { msg := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_RowBased, }, } @@ -145,7 +145,7 @@ func TestInsertMsg_RowBasedFormat(t *testing.T) { func TestInsertMsg_ColumnBasedFormat(t *testing.T) { msg := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Version: msgpb.InsertDataVersion_ColumnBased, }, } @@ -154,7 +154,7 @@ func TestInsertMsg_ColumnBasedFormat(t *testing.T) { func TestInsertMsg_NRows(t *testing.T) { msg1 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ RowData: []*commonpb.Blob{ {}, {}, @@ -165,7 +165,7 @@ func TestInsertMsg_NRows(t *testing.T) { } assert.Equal(t, uint64(2), msg1.NRows()) msg2 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ RowData: nil, FieldsData: []*schemapb.FieldData{ {}, @@ -179,7 +179,7 @@ func TestInsertMsg_NRows(t *testing.T) { func TestInsertMsg_CheckAligned(t *testing.T) { msg1 := &InsertMsg{ - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Timestamps: []uint64{1}, RowIDs: []int64{1}, RowData: []*commonpb.Blob{ @@ -217,7 +217,7 @@ func TestInsertMsg_IndexMsg(t *testing.T) { BeginTimestamp: 1, EndTimestamp: 2, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 3, @@ -272,7 +272,7 @@ func TestInsertMsg_IndexMsg(t *testing.T) { func TestDeleteMsg(t *testing.T) { deleteMsg := &DeleteMsg{ BaseMsg: generateBaseMsg(), - DeleteRequest: msgpb.DeleteRequest{ + DeleteRequest: &msgpb.DeleteRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Delete, MsgID: 1, @@ -321,7 +321,7 @@ func TestDeleteMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestTimeTickMsg(t *testing.T) { timeTickMsg := &TimeTickMsg{ BaseMsg: generateBaseMsg(), - TimeTickMsg: msgpb.TimeTickMsg{ + TimeTickMsg: &msgpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: 1, @@ -364,7 +364,7 @@ func TestTimeTickMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestCreateCollectionMsg(t *testing.T) { createCollectionMsg := &CreateCollectionMsg{ BaseMsg: generateBaseMsg(), - CreateCollectionRequest: msgpb.CreateCollectionRequest{ + CreateCollectionRequest: &msgpb.CreateCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreateCollection, MsgID: 1, @@ -416,7 +416,7 @@ func TestCreateCollectionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDropCollectionMsg(t *testing.T) { dropCollectionMsg := &DropCollectionMsg{ BaseMsg: generateBaseMsg(), - DropCollectionRequest: msgpb.DropCollectionRequest{ + DropCollectionRequest: &msgpb.DropCollectionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropCollection, MsgID: 1, @@ -463,7 +463,7 @@ func TestDropCollectionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestCreatePartitionMsg(t *testing.T) { createPartitionMsg := &CreatePartitionMsg{ BaseMsg: generateBaseMsg(), - CreatePartitionRequest: msgpb.CreatePartitionRequest{ + CreatePartitionRequest: &msgpb.CreatePartitionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_CreatePartition, MsgID: 1, @@ -512,7 +512,7 @@ func TestCreatePartitionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDropPartitionMsg(t *testing.T) { dropPartitionMsg := &DropPartitionMsg{ BaseMsg: generateBaseMsg(), - DropPartitionRequest: msgpb.DropPartitionRequest{ + DropPartitionRequest: &msgpb.DropPartitionRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DropPartition, MsgID: 1, @@ -561,7 +561,7 @@ func TestDropPartitionMsg_Unmarshal_IllegalParameter(t *testing.T) { func TestDataNodeTtMsg(t *testing.T) { dataNodeTtMsg := &DataNodeTtMsg{ BaseMsg: generateBaseMsg(), - DataNodeTtMsg: msgpb.DataNodeTtMsg{ + DataNodeTtMsg: &msgpb.DataNodeTtMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_DataNodeTt, MsgID: 1, diff --git a/pkg/mq/msgstream/unmarshal_test.go b/pkg/mq/msgstream/unmarshal_test.go index a1971f5c367d4..cabc70044d539 100644 --- a/pkg/mq/msgstream/unmarshal_test.go +++ b/pkg/mq/msgstream/unmarshal_test.go @@ -34,7 +34,7 @@ func Test_ProtoUnmarshalDispatcher(t *testing.T) { EndTimestamp: 0, HashValues: []uint32{1}, }, - InsertRequest: msgpb.InsertRequest{ + InsertRequest: &msgpb.InsertRequest{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_Insert, MsgID: 1, diff --git a/pkg/streaming/util/message/encoder.go b/pkg/streaming/util/message/encoder.go index 1d73d969063c0..2b97b28a431bc 100644 --- a/pkg/streaming/util/message/encoder.go +++ b/pkg/streaming/util/message/encoder.go @@ -4,7 +4,7 @@ import ( "encoding/base64" "strconv" - "github.com/pkg/errors" + "github.com/cockroachdb/errors" "google.golang.org/protobuf/proto" ) diff --git a/pkg/streaming/util/message/message_impl.go b/pkg/streaming/util/message/message_impl.go index b97445578104d..c9fd116cf3aff 100644 --- a/pkg/streaming/util/message/message_impl.go +++ b/pkg/streaming/util/message/message_impl.go @@ -57,7 +57,7 @@ func (m *messageImpl) WithTimeTick(tt uint64) MutableMessage { // WithLastConfirmed sets the last confirmed message id of current message. func (m *messageImpl) WithLastConfirmed(id MessageID) MutableMessage { - m.properties.Set(messageLastConfirmed, string(id.Marshal())) + m.properties.Set(messageLastConfirmed, id.Marshal()) return m } @@ -73,7 +73,7 @@ func (m *messageImpl) IntoImmutableMessage(id MessageID) ImmutableMessage { func (m *messageImpl) TimeTick() uint64 { value, ok := m.properties.Get(messageTimeTick) if !ok { - panic(fmt.Sprintf("there's a bug in the message codes, timetick lost in properties of message")) + panic("there's a bug in the message codes, timetick lost in properties of message") } tt, err := DecodeUint64(value) if err != nil { @@ -86,7 +86,7 @@ func (m *messageImpl) TimeTick() uint64 { func (m *messageImpl) VChannel() string { value, ok := m.properties.Get(messageVChannel) if !ok { - panic(fmt.Sprintf("there's a bug in the message codes, vchannel lost in properties of message")) + panic("there's a bug in the message codes, vchannel lost in properties of message") } return value } diff --git a/pkg/streaming/util/message/specialized_message.go b/pkg/streaming/util/message/specialized_message.go index 298ce6d6ca1ed..54c8496e6968c 100644 --- a/pkg/streaming/util/message/specialized_message.go +++ b/pkg/streaming/util/message/specialized_message.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/pkg/errors" + "github.com/cockroachdb/errors" "google.golang.org/protobuf/proto" "github.com/milvus-io/milvus-proto/go-api/v2/msgpb" diff --git a/pkg/util/funcutil/policy.go b/pkg/util/funcutil/policy.go index db10e6a7a1d5b..fc0482b35c579 100644 --- a/pkg/util/funcutil/policy.go +++ b/pkg/util/funcutil/policy.go @@ -1,10 +1,10 @@ package funcutil import ( - "errors" "fmt" "strings" + "github.com/cockroachdb/errors" "go.uber.org/zap" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index 079c8d5e8bf50..9edc26b77c9a8 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -1635,7 +1635,7 @@ type queryCoordConfig struct { RowCountMaxSteps ParamItem `refreshable:"true"` RandomMaxSteps ParamItem `refreshable:"true"` GrowingRowCountWeight ParamItem `refreshable:"true"` - DelegatorMemoryOverloadFactor ParamItem `refreshable:"true` + DelegatorMemoryOverloadFactor ParamItem `refreshable:"true"` BalanceCostThreshold ParamItem `refreshable:"true"` SegmentCheckInterval ParamItem `refreshable:"true"` @@ -1677,7 +1677,7 @@ type queryCoordConfig struct { CollectionObserverInterval ParamItem `refreshable:"false"` CheckExecutedFlagInterval ParamItem `refreshable:"false"` - CollectionBalanceSegmentBatchSize ParamItem `refreshable true` + CollectionBalanceSegmentBatchSize ParamItem `refreshable:"true"` } func (p *queryCoordConfig) init(base *BaseTable) { @@ -3136,7 +3136,7 @@ func (p *dataCoordConfig) init(base *BaseTable) { Key: "dataCoord.segment.sealProportionJitter", Version: "2.4.6", DefaultValue: "0.1", - Doc: "segment seal proportion jitter ratio, default value 0.1(10%), if seal propertion is 12%, with jitter=0.1, the actuall applied ratio will be 10.8~12%", + Doc: "segment seal proportion jitter ratio, default value 0.1(10%), if seal proportion is 12%, with jitter=0.1, the actuall applied ratio will be 10.8~12%", Export: true, } p.SegmentSealProportionJitter.Init(base.mgr) diff --git a/pkg/util/testutils/gen_data.go b/pkg/util/testutils/gen_data.go index 0eb692a2249b0..15b39933858ff 100644 --- a/pkg/util/testutils/gen_data.go +++ b/pkg/util/testutils/gen_data.go @@ -301,6 +301,48 @@ func GenerateFloat16VectorsWithInvalidData(numRows, dim int) []byte { return ret } +func GenerateSparseFloatVectorsData(numRows int) ([][]byte, int64) { + dim := 700 + avgNnz := 20 + var contents [][]byte + maxDim := 0 + + uniqueAndSort := func(indices []uint32) []uint32 { + seen := make(map[uint32]bool) + var result []uint32 + for _, value := range indices { + if _, ok := seen[value]; !ok { + seen[value] = true + result = append(result, value) + } + } + sort.Slice(result, func(i, j int) bool { + return result[i] < result[j] + }) + return result + } + + for i := 0; i < numRows; i++ { + nnz := rand.Intn(avgNnz*2) + 1 + indices := make([]uint32, 0, nnz) + for j := 0; j < nnz; j++ { + indices = append(indices, uint32(rand.Intn(dim))) + } + indices = uniqueAndSort(indices) + values := make([]float32, 0, len(indices)) + for j := 0; j < len(indices); j++ { + values = append(values, rand.Float32()) + } + if len(indices) > 0 && int(indices[len(indices)-1])+1 > maxDim { + maxDim = int(indices[len(indices)-1]) + 1 + } + rowBytes := typeutil.CreateSparseFloatRow(indices, values) + + contents = append(contents, rowBytes) + } + return contents, int64(maxDim) +} + func GenerateSparseFloatVectors(numRows int) *schemapb.SparseFloatArray { dim := 700 avgNnz := 20 diff --git a/pkg/util/typeutil/schema_test.go b/pkg/util/typeutil/schema_test.go index ec03333636292..ca3d34c69c061 100644 --- a/pkg/util/typeutil/schema_test.go +++ b/pkg/util/typeutil/schema_test.go @@ -982,7 +982,7 @@ func TestDeleteFieldData(t *testing.T) { assert.Equal(t, BFloat16Vector[2*Dim:4*Dim], result2[BFloat16VectorFieldID-common.StartOfUserFieldID].GetVectors().Data.(*schemapb.VectorField_Bfloat16Vector).Bfloat16Vector) tmpSparseFloatVector = proto.Clone(SparseFloatVector).(*schemapb.SparseFloatArray) tmpSparseFloatVector.Contents = [][]byte{SparseFloatVector.Contents[1]} - assert.EqualExportedValues(t, *tmpSparseFloatVector, *result2[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) + assert.EqualExportedValues(t, tmpSparseFloatVector, result2[SparseFloatVectorFieldID-common.StartOfUserFieldID].GetVectors().GetSparseFloatVector()) } func TestEstimateEntitySize(t *testing.T) { diff --git a/tests/go_client/go.mod b/tests/go_client/go.mod index 4e52093107c6b..8346f93dab64c 100644 --- a/tests/go_client/go.mod +++ b/tests/go_client/go.mod @@ -5,22 +5,20 @@ go 1.21 toolchain go1.21.10 require ( - github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 + github.com/milvus-io/milvus/client/v2 v2.0.0-20240729131949-a8a4779749de github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3 github.com/quasilyte/go-ruleguard/dsl v0.3.22 github.com/stretchr/testify v1.9.0 github.com/x448/float16 v0.8.4 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.64.0 + google.golang.org/grpc v1.65.0 ) -// replace github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 => ../../../milvus/client - require ( github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/cenkalti/backoff/v4 v4.2.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cilium/ebpf v0.11.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect @@ -38,9 +36,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/godbus/dbus/v5 v5.0.4 // indirect - github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/gogo/status v1.1.0 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/gorilla/websocket v1.4.2 // indirect @@ -111,17 +107,17 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/automaxprocs v1.5.2 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.22.0 // indirect + golang.org/x/crypto v0.23.0 // indirect golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sync v0.6.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect diff --git a/tests/go_client/go.sum b/tests/go_client/go.sum index 6b8914e680627..6eb69a86a105f 100644 --- a/tests/go_client/go.sum +++ b/tests/go_client/go.sum @@ -25,10 +25,9 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= -cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -81,8 +80,8 @@ github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6 github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -97,8 +96,8 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50 h1:DBmgJDC9dTfkVyGgipamEh2BpGYxScCH1TOF1LL1cXc= -github.com/cncf/xds/go v0.0.0-20240318125728-8a4994d93e50/go.mod h1:5e1+Vvlzido69INQaVO6d87Qn543Xr6nooe9Kz7oBFM= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b h1:ga8SEFjZ60pxLcmhnThWgvH2wg8376yUJmPhEH4H3kw= +github.com/cncf/xds/go v0.0.0-20240423153145-555b57ec207b/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= @@ -196,7 +195,6 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -204,13 +202,12 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/gogo/status v1.1.0 h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -403,8 +400,8 @@ github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/le github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632 h1:CXig0DNtUsCLzchCFe3PR2KgOdobbz9gK2nSV7195PM= github.com/milvus-io/milvus-proto/go-api/v2 v2.3.4-0.20240717062137-3ffb1db01632/go.mod h1:/6UT4zZl6awVeXLeE7UGDWZvXj3IWkRsh3mqsn0DiAs= -github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68 h1:Qxyz3e0IlGmqf126iYgmKKEVpSbNStb6LfInpUhtFtk= -github.com/milvus-io/milvus/client/v2 v2.0.0-20240704083609-fcafdb6d5f68/go.mod h1:13uL9ukc9KRK5ZtWqWwaORWlRccZLIysZzT6KUlOx+A= +github.com/milvus-io/milvus/client/v2 v2.0.0-20240729131949-a8a4779749de h1:GtxjVQ5VfGNf/bEN/K4zKCnVXtq7PkSsniWVlAF7GlI= +github.com/milvus-io/milvus/client/v2 v2.0.0-20240729131949-a8a4779749de/go.mod h1:CGX8NwpP5T7tSDzYOBJDgyW1PK/vNixosoR8r5BMqMA= github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3 h1:ZBpRWhBa7FTFxW4YYVv9AUESoW1Xyb3KNXTzTqfkZmw= github.com/milvus-io/milvus/pkg v0.0.2-0.20240317152703-17b4938985f3/go.mod h1:jQ2BUZny1COsgv1Qbcv8dmbppW+V9J/c4YQZNb3EOm8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -693,8 +690,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -777,8 +774,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -792,8 +789,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -806,8 +803,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -988,8 +985,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1037,10 +1032,10 @@ google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+n google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= -google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= +google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1066,8 +1061,8 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1081,8 +1076,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=