diff --git a/internal/core/src/common/QueryResult.h b/internal/core/src/common/QueryResult.h index 44b48c15053dd..bb7debab3692e 100644 --- a/internal/core/src/common/QueryResult.h +++ b/internal/core/src/common/QueryResult.h @@ -107,10 +107,10 @@ 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++); + std::make_shared(origin_pair, idx++); heap_.push(off_dis_pair); } } diff --git a/internal/core/src/exec/expression/UnaryExpr.cpp b/internal/core/src/exec/expression/UnaryExpr.cpp index 8585f72e53deb..1257b2f6ae3b0 100644 --- a/internal/core/src/exec/expression/UnaryExpr.cpp +++ b/internal/core/src/exec/expression/UnaryExpr.cpp @@ -297,7 +297,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/visitors/ExecPlanNodeVisitor.cpp b/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp index 25190e5c821c9..f0c45125a8132 100644 --- a/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp +++ b/internal/core/src/query/visitors/ExecPlanNodeVisitor.cpp @@ -230,8 +230,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/storage/DiskFileManagerImpl.cpp b/internal/core/src/storage/DiskFileManagerImpl.cpp index 8ef6dac110b53..95a9ac49cc3db 100644 --- a/internal/core/src/storage/DiskFileManagerImpl.cpp +++ b/internal/core/src/storage/DiskFileManagerImpl.cpp @@ -491,9 +491,10 @@ DiskFileManagerImpl::CacheRawDataToDisk(std::vector remote_files) { if (data_type == milvus::DataType::VECTOR_SPARSE_FLOAT) { dim = std::max( dim, - (uint32_t)(std::dynamic_pointer_cast< - FieldData>(field_data) - ->Dim())); + (uint32_t)( + std::dynamic_pointer_cast>( + field_data) + ->Dim())); auto sparse_rows = static_cast*>( field_data->Data()); diff --git a/internal/core/unittest/test_utils/DataGen.h b/internal/core/unittest/test_utils/DataGen.h index 9b3cec9d2b410..7e88a7034ab39 100644 --- a/internal/core/unittest/test_utils/DataGen.h +++ b/internal/core/unittest/test_utils/DataGen.h @@ -289,14 +289,13 @@ GenerateRandomSparseFloatVector(size_t rows, return tensor; } -inline GeneratedData -DataGen(SchemaPtr schema, - int64_t N, - uint64_t seed = 42, - uint64_t ts_offset = 0, - int repeat_count = 1, - int array_len = 10, - bool random_pk = false) { +inline GeneratedData DataGen(SchemaPtr schema, + int64_t N, + uint64_t seed = 42, + uint64_t ts_offset = 0, + int repeat_count = 1, + int array_len = 10, + bool random_pk = false) { using std::vector; std::default_random_engine random(seed); std::normal_distribution<> distr(0, 1); 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/proxy/accesslog/info/grpc_info.go b/internal/proxy/accesslog/info/grpc_info.go index cc9718fac5eb1..570ac03889d8e 100644 --- a/internal/proxy/accesslog/info/grpc_info.go +++ b/internal/proxy/accesslog/info/grpc_info.go @@ -22,6 +22,7 @@ import ( "path" "time" + "github.com/golang/protobuf/proto" "go.opentelemetry.io/otel/trace" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -29,7 +30,6 @@ import ( "google.golang.org/grpc/peer" "google.golang.org/grpc/status" - "github.com/golang/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" 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/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index bccc1842ff48e..4bc7e5243f589 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -1595,7 +1595,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"` @@ -1638,7 +1638,7 @@ type queryCoordConfig struct { CollectionObserverInterval ParamItem `refreshable:"false"` CheckExecutedFlagInterval ParamItem `refreshable:"false"` UpdateCollectionLoadStatusInterval ParamItem `refreshable:"false"` - CollectionBalanceSegmentBatchSize ParamItem `refreshable true` + CollectionBalanceSegmentBatchSize ParamItem `refreshable:"true"` } func (p *queryCoordConfig) init(base *BaseTable) {