diff --git a/internal/core/src/segcore/SegmentInterface.cpp b/internal/core/src/segcore/SegmentInterface.cpp index 502bcd083ef0e..6779b56654647 100644 --- a/internal/core/src/segcore/SegmentInterface.cpp +++ b/internal/core/src/segcore/SegmentInterface.cpp @@ -67,11 +67,12 @@ SegmentInternalInterface::FillTargetEntry(const query::Plan* plan, std::unique_ptr SegmentInternalInterface::Search( const query::Plan* plan, - const query::PlaceholderGroup* placeholder_group) const { + const query::PlaceholderGroup* placeholder_group, + Timestamp timestamp) const { std::shared_lock lck(mutex_); milvus::tracer::AddEvent("obtained_segment_lock_mutex"); check_search(plan); - query::ExecPlanNodeVisitor visitor(*this, 1L << 63, placeholder_group); + query::ExecPlanNodeVisitor visitor(*this, timestamp, placeholder_group); auto results = std::make_unique(); *results = visitor.get_moved_result(*plan->plan_node_); results->segment_ = (void*)this; diff --git a/internal/core/src/segcore/SegmentInterface.h b/internal/core/src/segcore/SegmentInterface.h index b8d19de0d1640..a5fbc8014d602 100644 --- a/internal/core/src/segcore/SegmentInterface.h +++ b/internal/core/src/segcore/SegmentInterface.h @@ -54,7 +54,8 @@ class SegmentInterface { virtual std::unique_ptr Search(const query::Plan* Plan, - const query::PlaceholderGroup* placeholder_group) const = 0; + const query::PlaceholderGroup* placeholder_group, + Timestamp timestamp) const = 0; virtual std::unique_ptr Retrieve(const query::RetrievePlan* Plan, @@ -136,7 +137,8 @@ class SegmentInternalInterface : public SegmentInterface { std::unique_ptr Search(const query::Plan* Plan, - const query::PlaceholderGroup* placeholder_group) const override; + const query::PlaceholderGroup* placeholder_group, + Timestamp timestamp) const override; void FillPrimaryKeys(const query::Plan* plan, diff --git a/internal/core/src/segcore/segment_c.cpp b/internal/core/src/segcore/segment_c.cpp index e997eb5b88adc..814b504bc0eb4 100644 --- a/internal/core/src/segcore/segment_c.cpp +++ b/internal/core/src/segcore/segment_c.cpp @@ -80,6 +80,7 @@ Search(CSegmentInterface c_segment, CSearchPlan c_plan, CPlaceholderGroup c_placeholder_group, CTraceContext c_trace, + uint64_t timestamp, CSearchResult* result) { try { auto segment = (milvus::segcore::SegmentInterface*)c_segment; @@ -90,7 +91,7 @@ Search(CSegmentInterface c_segment, c_trace.traceID, c_trace.spanID, c_trace.flag}; auto span = milvus::tracer::StartSpan("SegCoreSearch", &ctx); milvus::tracer::SetRootSpan(span); - auto search_result = segment->Search(plan, phg_ptr); + auto search_result = segment->Search(plan, phg_ptr, timestamp); if (!milvus::PositivelyRelated( plan->plan_node_->search_info_.metric_type_)) { for (auto& dis : search_result->distances_) { diff --git a/internal/core/src/segcore/segment_c.h b/internal/core/src/segcore/segment_c.h index 118b69ff9c070..b638232ab2a46 100644 --- a/internal/core/src/segcore/segment_c.h +++ b/internal/core/src/segcore/segment_c.h @@ -45,6 +45,7 @@ Search(CSegmentInterface c_segment, CSearchPlan c_plan, CPlaceholderGroup c_placeholder_group, CTraceContext c_trace, + uint64_t timestamp, CSearchResult* result); void diff --git a/internal/core/unittest/bench/bench_search.cpp b/internal/core/unittest/bench/bench_search.cpp index f1334c7a3ed7e..fabfa38fc7c74 100644 --- a/internal/core/unittest/bench/bench_search.cpp +++ b/internal/core/unittest/bench/bench_search.cpp @@ -90,8 +90,10 @@ Search_GrowingIndex(benchmark::State& state) { dataset_.timestamps_.data(), dataset_.raw_); + Timestamp ts = 10000000; + for (auto _ : state) { - auto qr = segment->Search(search_plan.get(), ph_group.get()); + auto qr = segment->Search(search_plan.get(), ph_group.get(), ts); } } @@ -114,7 +116,8 @@ Search_Sealed(benchmark::State& state) { } else if (choice == 1) { // hnsw auto vec = dataset_.get_col(milvus::FieldId(100)); - auto indexing = GenVecIndexing(N, dim, vec.data(), knowhere::IndexEnum::INDEX_HNSW); + auto indexing = + GenVecIndexing(N, dim, vec.data(), knowhere::IndexEnum::INDEX_HNSW); segcore::LoadIndexInfo info; info.index = std::move(indexing); info.field_id = (*schema)[FieldName("fakevec")].get_id().get(); @@ -123,8 +126,11 @@ Search_Sealed(benchmark::State& state) { segment->DropFieldData(milvus::FieldId(100)); segment->LoadIndex(info); } + + Timestamp ts = 10000000; + for (auto _ : state) { - auto qr = segment->Search(search_plan.get(), ph_group.get()); + auto qr = segment->Search(search_plan.get(), ph_group.get(), ts); } } diff --git a/internal/core/unittest/test_binlog_index.cpp b/internal/core/unittest/test_binlog_index.cpp index 4d4c3faf23f43..7cd14c0b6deb4 100644 --- a/internal/core/unittest/test_binlog_index.cpp +++ b/internal/core/unittest/test_binlog_index.cpp @@ -191,7 +191,8 @@ TEST_P(BinlogIndexTest, Accuracy) { std::vector ph_group_arr = { ph_group.get()}; auto nlist = segcore_config.get_nlist(); - auto binlog_index_sr = segment->Search(plan.get(), ph_group.get()); + auto binlog_index_sr = + segment->Search(plan.get(), ph_group.get(), 1L << 63); ASSERT_EQ(binlog_index_sr->total_nq_, num_queries); EXPECT_EQ(binlog_index_sr->unity_topK_, topk); EXPECT_EQ(binlog_index_sr->distances_.size(), num_queries * topk); @@ -226,7 +227,7 @@ TEST_P(BinlogIndexTest, Accuracy) { EXPECT_TRUE(segment->HasIndex(vec_field_id)); EXPECT_EQ(segment->get_row_count(), data_n); EXPECT_FALSE(segment->HasFieldData(vec_field_id)); - auto ivf_sr = segment->Search(plan.get(), ph_group.get()); + auto ivf_sr = segment->Search(plan.get(), ph_group.get(), 1L << 63); auto similary = GetKnnSearchRecall(num_queries, binlog_index_sr->seg_offsets_.data(), topk, @@ -312,4 +313,4 @@ TEST_P(BinlogIndexTest, LoadBinlogWithoutIndexMeta) { EXPECT_FALSE(segment->HasIndex(vec_field_id)); EXPECT_EQ(segment->get_row_count(), data_n); EXPECT_TRUE(segment->HasFieldData(vec_field_id)); -} \ No newline at end of file +} diff --git a/internal/core/unittest/test_c_api.cpp b/internal/core/unittest/test_c_api.cpp index 83f9717555fc8..452b19d60d26a 100644 --- a/internal/core/unittest/test_c_api.cpp +++ b/internal/core/unittest/test_c_api.cpp @@ -1075,11 +1075,13 @@ TEST(CApiTest, SearchTest) { placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result); ASSERT_EQ(res.error_code, Success); CSearchResult search_result2; - auto res2 = Search(segment, plan, placeholderGroup, {}, &search_result2); + auto res2 = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result2); ASSERT_EQ(res2.error_code, Success); DeleteSearchPlan(plan); @@ -1143,7 +1145,12 @@ TEST(CApiTest, SearchTestWithExpr) { dataset.timestamps_.push_back(1); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = Search(segment, + plan, + placeholderGroup, + {}, + dataset.timestamps_[0], + &search_result); ASSERT_EQ(res.error_code, Success); DeleteSearchPlan(plan); @@ -1427,7 +1434,7 @@ TEST(CApiTest, ReduceNullResult) { auto slice_topKs = std::vector{1}; std::vector results; CSearchResult res; - status = Search(segment, plan, placeholderGroup, {}, &res); + status = Search(segment, plan, placeholderGroup, {}, 1L << 63, &res); ASSERT_EQ(status.error_code, Success); results.push_back(res); CSearchResultDataBlobs cSearchResultData; @@ -1514,9 +1521,11 @@ TEST(CApiTest, ReduceRemoveDuplicates) { auto slice_topKs = std::vector{topK / 2, topK}; std::vector results; CSearchResult res1, res2; - status = Search(segment, plan, placeholderGroup, {}, &res1); + status = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[0], &res1); ASSERT_EQ(status.error_code, Success); - status = Search(segment, plan, placeholderGroup, {}, &res2); + status = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[0], &res2); ASSERT_EQ(status.error_code, Success); results.push_back(res1); results.push_back(res2); @@ -1545,11 +1554,14 @@ TEST(CApiTest, ReduceRemoveDuplicates) { auto slice_topKs = std::vector{topK / 2, topK, topK}; std::vector results; CSearchResult res1, res2, res3; - status = Search(segment, plan, placeholderGroup, {}, &res1); + status = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[0], &res1); ASSERT_EQ(status.error_code, Success); - status = Search(segment, plan, placeholderGroup, {}, &res2); + status = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[0], &res2); ASSERT_EQ(status.error_code, Success); - status = Search(segment, plan, placeholderGroup, {}, &res3); + status = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[0], &res3); ASSERT_EQ(status.error_code, Success); results.push_back(res1); results.push_back(res2); @@ -1666,9 +1678,11 @@ testReduceSearchWithExpr(int N, std::vector results; CSearchResult res1; CSearchResult res2; - auto res = Search(segment, plan, placeholderGroup, {}, &res1); + auto res = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[N - 1], &res1); ASSERT_EQ(res.error_code, Success); - res = Search(segment, plan, placeholderGroup, {}, &res2); + res = Search( + segment, plan, placeholderGroup, {}, dataset.timestamps_[N - 1], &res2); ASSERT_EQ(res.error_code, Success); results.push_back(res1); results.push_back(res2); @@ -1900,9 +1914,15 @@ TEST(CApiTest, Indexing_Without_Predicate) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestmap = 10000000; + CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestmap, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -1962,6 +1982,7 @@ TEST(CApiTest, Indexing_Without_Predicate) { plan, placeholderGroup, {}, + timestmap, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2044,9 +2065,15 @@ TEST(CApiTest, Indexing_Expr_Without_Predicate) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; + CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2107,6 +2134,7 @@ TEST(CApiTest, Indexing_Expr_Without_Predicate) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2217,10 +2245,15 @@ TEST(CApiTest, Indexing_With_float_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2281,6 +2314,7 @@ TEST(CApiTest, Indexing_With_float_Predicate_Range) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2393,10 +2427,15 @@ TEST(CApiTest, Indexing_Expr_With_float_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2457,6 +2496,7 @@ TEST(CApiTest, Indexing_Expr_With_float_Predicate_Range) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2561,10 +2601,15 @@ TEST(CApiTest, Indexing_With_float_Predicate_Term) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2625,6 +2670,7 @@ TEST(CApiTest, Indexing_With_float_Predicate_Term) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2730,10 +2776,15 @@ TEST(CApiTest, Indexing_Expr_With_float_Predicate_Term) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2794,6 +2845,7 @@ TEST(CApiTest, Indexing_Expr_With_float_Predicate_Term) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -2904,10 +2956,15 @@ TEST(CApiTest, Indexing_With_binary_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -2969,6 +3026,7 @@ TEST(CApiTest, Indexing_With_binary_Predicate_Range) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -3079,10 +3137,15 @@ TEST(CApiTest, Indexing_Expr_With_binary_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_TRUE(res_before_load_index.error_code == Success) << res_before_load_index.error_msg; @@ -3144,6 +3207,7 @@ TEST(CApiTest, Indexing_Expr_With_binary_Predicate_Range) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -3249,10 +3313,15 @@ TEST(CApiTest, Indexing_With_binary_Predicate_Term) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -3313,6 +3382,7 @@ TEST(CApiTest, Indexing_With_binary_Predicate_Term) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -3440,11 +3510,15 @@ TEST(CApiTest, Indexing_Expr_With_binary_Predicate_Term) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); - Timestamp time = 10000000; + Timestamp timestamp = 10000000; CSearchResult c_search_result_on_smallIndex; - auto res_before_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_smallIndex); + auto res_before_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_smallIndex); ASSERT_EQ(res_before_load_index.error_code, Success); // load index to segment @@ -3505,6 +3579,7 @@ TEST(CApiTest, Indexing_Expr_With_binary_Predicate_Term) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -3643,7 +3718,7 @@ TEST(CApiTest, SealedSegment_search_float_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); - Timestamp time = 10000000; + Timestamp timestamp = 10000000; // load index to segment auto indexing = generate_index(vec_col.data(), @@ -3702,6 +3777,7 @@ TEST(CApiTest, SealedSegment_search_float_Predicate_Range) { plan, placeholderGroup, {}, + timestamp, &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); @@ -3780,12 +3856,14 @@ TEST(CApiTest, SealedSegment_search_without_predicates) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = Search( + segment, plan, placeholderGroup, {}, N + ts_offset, &search_result); std::cout << res.error_msg << std::endl; ASSERT_EQ(res.error_code, Success); CSearchResult search_result2; - auto res2 = Search(segment, plan, placeholderGroup, {}, &search_result2); + auto res2 = Search( + segment, plan, placeholderGroup, {}, N + ts_offset, &search_result2); ASSERT_EQ(res2.error_code, Success); DeleteSearchPlan(plan); @@ -3874,6 +3952,7 @@ TEST(CApiTest, SealedSegment_search_float_With_Expr_Predicate_Range) { std::vector placeholderGroups; placeholderGroups.push_back(placeholderGroup); + Timestamp timestamp = 10000000; // load index to segment auto indexing = generate_index(vec_col.data(), @@ -3933,8 +4012,12 @@ TEST(CApiTest, SealedSegment_search_float_With_Expr_Predicate_Range) { } CSearchResult c_search_result_on_bigIndex; - auto res_after_load_index = Search( - segment, plan, placeholderGroup, {}, &c_search_result_on_bigIndex); + auto res_after_load_index = Search(segment, + plan, + placeholderGroup, + {}, + timestamp, + &c_search_result_on_bigIndex); ASSERT_EQ(res_after_load_index.error_code, Success); auto search_result_on_bigIndex = (SearchResult*)c_search_result_on_bigIndex; @@ -4230,7 +4313,8 @@ TEST(CApiTest, RANGE_SEARCH_WITH_RADIUS_WHEN_IP) { placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result); ASSERT_EQ(res.error_code, Success); DeleteSearchPlan(plan); @@ -4293,7 +4377,8 @@ TEST(CApiTest, RANGE_SEARCH_WITH_RADIUS_AND_RANGE_FILTER_WHEN_IP) { placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result); ASSERT_EQ(res.error_code, Success); DeleteSearchPlan(plan); @@ -4356,7 +4441,8 @@ TEST(CApiTest, RANGE_SEARCH_WITH_RADIUS_WHEN_L2) { placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result); ASSERT_EQ(res.error_code, Success); DeleteSearchPlan(plan); @@ -4419,7 +4505,8 @@ TEST(CApiTest, RANGE_SEARCH_WITH_RADIUS_AND_RANGE_FILTER_WHEN_L2) { placeholderGroups.push_back(placeholderGroup); CSearchResult search_result; - auto res = Search(segment, plan, placeholderGroup, {}, &search_result); + auto res = + Search(segment, plan, placeholderGroup, {}, ts_offset, &search_result); ASSERT_EQ(res.error_code, Success); DeleteSearchPlan(plan); diff --git a/internal/core/unittest/test_float16.cpp b/internal/core/unittest/test_float16.cpp index f41f6f9cebbbb..81674884ef045 100644 --- a/internal/core/unittest/test_float16.cpp +++ b/internal/core/unittest/test_float16.cpp @@ -154,7 +154,7 @@ TEST(Float16, ExecWithoutPredicateFlat) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), 1L << 63); int topk = 5; query::Json json = SearchResultToJson(*sr); @@ -392,7 +392,7 @@ TEST(Float16, ExecWithPredicate) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), 1L << 63); int topk = 5; query::Json json = SearchResultToJson(*sr); diff --git a/internal/core/unittest/test_group_by.cpp b/internal/core/unittest/test_group_by.cpp index 3e8ef859edff8..50dc8c1ecf194 100644 --- a/internal/core/unittest/test_group_by.cpp +++ b/internal/core/unittest/test_group_by.cpp @@ -1,7 +1,17 @@ +// Copyright (C) 2019-2020 Zilliz. All rights reserved. // -// Created by zilliz on 2023/12/1. +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 // +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under the License +// +// Created by zilliz on 2023/12/1. +// #include #include "common/Schema.h" @@ -20,29 +30,29 @@ using namespace milvus::storage; const char* METRICS_TYPE = "metric_type"; - void prepareSegmentSystemFieldData(const std::unique_ptr& segment, size_t row_count, - GeneratedData& data_set){ + GeneratedData& data_set) { auto field_data = - std::make_shared>(DataType::INT64); + std::make_shared>(DataType::INT64); field_data->FillFieldData(data_set.row_ids_.data(), row_count); - auto field_data_info = FieldDataInfo{ - RowFieldID.get(), row_count, std::vector{field_data}}; + auto field_data_info = + FieldDataInfo{RowFieldID.get(), + row_count, + std::vector{field_data}}; segment->LoadFieldData(RowFieldID, field_data_info); - field_data = - std::make_shared>(DataType::INT64); + field_data = std::make_shared>(DataType::INT64); field_data->FillFieldData(data_set.timestamps_.data(), row_count); field_data_info = - FieldDataInfo{TimestampFieldID.get(), - row_count, - std::vector{field_data}}; + FieldDataInfo{TimestampFieldID.get(), + row_count, + std::vector{field_data}}; segment->LoadFieldData(TimestampFieldID, field_data_info); } -TEST(GroupBY, Normal2){ +TEST(GroupBY, Normal2) { using namespace milvus; using namespace milvus::query; using namespace milvus::segcore; @@ -51,7 +61,7 @@ TEST(GroupBY, Normal2){ int dim = 64; auto schema = std::make_shared(); auto vec_fid = schema->AddDebugField( - "fakevec", DataType::VECTOR_FLOAT, dim, knowhere::metric::L2); + "fakevec", DataType::VECTOR_FLOAT, dim, knowhere::metric::L2); auto int8_fid = schema->AddDebugField("int8", DataType::INT8); auto int16_fid = schema->AddDebugField("int16", DataType::INT16); auto int32_fid = schema->AddDebugField("int32", DataType::INT32); @@ -71,7 +81,7 @@ TEST(GroupBY, Normal2){ auto info = FieldDataInfo(field_data.field_id(), N); auto field_meta = fields.at(FieldId(field_id)); info.channel->push( - CreateFieldDataFromDataArray(N, &field_data, field_meta)); + CreateFieldDataFromDataArray(N, &field_data, field_meta)); info.channel->close(); segment->LoadFieldData(FieldId(field_id), info); @@ -80,7 +90,8 @@ TEST(GroupBY, Normal2){ //3. load index auto vector_data = raw_data.get_col(vec_fid); - auto indexing = GenVecIndexing(N, dim, vector_data.data(), knowhere::IndexEnum::INDEX_HNSW); + auto indexing = GenVecIndexing( + N, dim, vector_data.data(), knowhere::IndexEnum::INDEX_HNSW); LoadIndexInfo load_index_info; load_index_info.field_id = vec_fid.get(); load_index_info.index = std::move(indexing); @@ -102,26 +113,34 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set i8_set; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { int8_t g_val = std::get(group_by_values[i]); - ASSERT_FALSE(i8_set.count(g_val)>0);//no repetition on groupBy field + ASSERT_FALSE(i8_set.count(g_val) > + 0); //no repetition on groupBy field i8_set.insert(g_val); auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding @@ -146,26 +165,34 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set i16_set; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { int16_t g_val = std::get(group_by_values[i]); - ASSERT_FALSE(i16_set.count(g_val)>0);//no repetition on groupBy field + ASSERT_FALSE(i16_set.count(g_val) > + 0); //no repetition on groupBy field i16_set.insert(g_val); auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding @@ -190,26 +217,34 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set i32_set; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { int16_t g_val = std::get(group_by_values[i]); - ASSERT_FALSE(i32_set.count(g_val)>0);//no repetition on groupBy field + ASSERT_FALSE(i32_set.count(g_val) > + 0); //no repetition on groupBy field i32_set.insert(g_val); auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding @@ -234,26 +269,34 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set i64_set; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { int16_t g_val = std::get(group_by_values[i]); - ASSERT_FALSE(i64_set.count(g_val)>0);//no repetition on groupBy field + ASSERT_FALSE(i64_set.count(g_val) > + 0); //no repetition on groupBy field i64_set.insert(g_val); auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding @@ -278,26 +321,35 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set strs_set; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ - std::string_view g_val = std::get(group_by_values[i]); - ASSERT_FALSE(strs_set.count(g_val)>0);//no repetition on groupBy field + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { + std::string_view g_val = + std::get(group_by_values[i]); + ASSERT_FALSE(strs_set.count(g_val) > + 0); //no repetition on groupBy field strs_set.insert(g_val); auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding @@ -322,40 +374,48 @@ TEST(GroupBY, Normal2){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 1; auto seed = 1024; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto search_result = segment->Search(plan.get(), ph_group.get()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto search_result = + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto& group_by_values = search_result->group_by_values_; - ASSERT_EQ(search_result->group_by_values_.size(), search_result->seg_offsets_.size()); - ASSERT_EQ(search_result->distances_.size(), search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->group_by_values_.size(), + search_result->seg_offsets_.size()); + ASSERT_EQ(search_result->distances_.size(), + search_result->seg_offsets_.size()); int size = group_by_values.size(); std::unordered_set bools_set; int boolValCount = 0; float lastDistance = 0.0; - for(size_t i = 0; i < size; i++){ - if(std::holds_alternative(group_by_values[i])){ + for (size_t i = 0; i < size; i++) { + if (std::holds_alternative(group_by_values[i])) { bool g_val = std::get(group_by_values[i]); - ASSERT_FALSE(bools_set.count(g_val)>0);//no repetition on groupBy field + ASSERT_FALSE(bools_set.count(g_val) > + 0); //no repetition on groupBy field bools_set.insert(g_val); - boolValCount+=1; + boolValCount += 1; auto distance = search_result->distances_.at(i); - ASSERT_TRUE(lastDistance<=distance);//distance should be decreased as metrics_type is L2 + ASSERT_TRUE( + lastDistance <= + distance); //distance should be decreased as metrics_type is L2 lastDistance = distance; } else { //check padding ASSERT_EQ(search_result->seg_offsets_[i], INVALID_SEG_OFFSET); ASSERT_EQ(search_result->distances_[i], 0.0); } - ASSERT_TRUE(boolValCount<=2);//bool values cannot exceed two + ASSERT_TRUE(boolValCount <= 2); //bool values cannot exceed two } } } -TEST(GroupBY, Reduce){ +TEST(GroupBY, Reduce) { using namespace milvus; using namespace milvus::query; using namespace milvus::segcore; @@ -364,7 +424,7 @@ TEST(GroupBY, Reduce){ int dim = 64; auto schema = std::make_shared(); auto vec_fid = schema->AddDebugField( - "fakevec", DataType::VECTOR_FLOAT, dim, knowhere::metric::L2); + "fakevec", DataType::VECTOR_FLOAT, dim, knowhere::metric::L2); auto int64_fid = schema->AddDebugField("int64", DataType::INT64); schema->set_primary_field_id(int64_fid); auto segment1 = CreateSealedSegment(schema); @@ -386,7 +446,7 @@ TEST(GroupBY, Reduce){ auto info = FieldDataInfo(field_data.field_id(), N); auto field_meta = fields.at(FieldId(field_id)); info.channel->push( - CreateFieldDataFromDataArray(N, &field_data, field_meta)); + CreateFieldDataFromDataArray(N, &field_data, field_meta)); info.channel->close(); segment1->LoadFieldData(FieldId(field_id), info); } @@ -398,7 +458,7 @@ TEST(GroupBY, Reduce){ auto info = FieldDataInfo(field_data.field_id(), N); auto field_meta = fields.at(FieldId(field_id)); info.channel->push( - CreateFieldDataFromDataArray(N, &field_data, field_meta)); + CreateFieldDataFromDataArray(N, &field_data, field_meta)); info.channel->close(); segment2->LoadFieldData(FieldId(field_id), info); } @@ -406,7 +466,8 @@ TEST(GroupBY, Reduce){ //3. load index auto vector_data_1 = raw_data1.get_col(vec_fid); - auto indexing_1 = GenVecIndexing(N, dim, vector_data_1.data(), knowhere::IndexEnum::INDEX_HNSW); + auto indexing_1 = GenVecIndexing( + N, dim, vector_data_1.data(), knowhere::IndexEnum::INDEX_HNSW); LoadIndexInfo load_index_info_1; load_index_info_1.field_id = vec_fid.get(); load_index_info_1.index = std::move(indexing_1); @@ -414,14 +475,14 @@ TEST(GroupBY, Reduce){ segment1->LoadIndex(load_index_info_1); auto vector_data_2 = raw_data2.get_col(vec_fid); - auto indexing_2 = GenVecIndexing(N, dim, vector_data_2.data(), knowhere::IndexEnum::INDEX_HNSW); + auto indexing_2 = GenVecIndexing( + N, dim, vector_data_2.data(), knowhere::IndexEnum::INDEX_HNSW); LoadIndexInfo load_index_info_2; load_index_info_2.field_id = vec_fid.get(); load_index_info_2.index = std::move(indexing_2); load_index_info_2.index_params[METRICS_TYPE] = knowhere::metric::L2; segment2->LoadIndex(load_index_info_2); - //4. search group by respectively const char* raw_plan = R"(vector_anns: < field_id: 100 @@ -435,11 +496,13 @@ TEST(GroupBY, Reduce){ >)"; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); - auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); + auto plan = + CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto num_queries = 10; auto topK = 100; auto ph_group_raw = CreatePlaceholderGroup(num_queries, dim, seed); - auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + auto ph_group = + ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); CPlaceholderGroup c_ph_group = ph_group.release(); CSearchPlan c_plan = plan.release(); @@ -447,9 +510,11 @@ TEST(GroupBY, Reduce){ CSegmentInterface c_segment_2 = segment2.release(); CSearchResult c_search_res_1; CSearchResult c_search_res_2; - auto status = Search(c_segment_1, c_plan, c_ph_group, {}, &c_search_res_1); + auto status = + Search(c_segment_1, c_plan, c_ph_group, {}, 1L << 63, &c_search_res_1); ASSERT_EQ(status.error_code, Success); - status = Search(c_segment_2, c_plan, c_ph_group, {}, &c_search_res_2); + status = + Search(c_segment_2, c_plan, c_ph_group, {}, 1L << 63, &c_search_res_2); ASSERT_EQ(status.error_code, Success); std::vector results; results.push_back(c_search_res_1); @@ -458,23 +523,20 @@ TEST(GroupBY, Reduce){ auto slice_nqs = std::vector{num_queries / 2, num_queries / 2}; auto slice_topKs = std::vector{topK / 2, topK}; CSearchResultDataBlobs cSearchResultData; - status = ReduceSearchResultsAndFillData( - &cSearchResultData, - c_plan, - results.data(), - results.size(), - slice_nqs.data(), - slice_topKs.data(), - slice_nqs.size() - ); + status = ReduceSearchResultsAndFillData(&cSearchResultData, + c_plan, + results.data(), + results.size(), + slice_nqs.data(), + slice_topKs.data(), + slice_nqs.size()); CheckSearchResultDuplicate(results); DeleteSearchResult(c_search_res_1); DeleteSearchResult(c_search_res_2); DeleteSearchResultDataBlobs(cSearchResultData); - DeleteSearchPlan(c_plan); DeletePlaceholderGroup(c_ph_group); DeleteSegment(c_segment_1); DeleteSegment(c_segment_2); -} \ No newline at end of file +} diff --git a/internal/core/unittest/test_growing_index.cpp b/internal/core/unittest/test_growing_index.cpp index 3666dc7cf0ddd..54f09c4474044 100644 --- a/internal/core/unittest/test_growing_index.cpp +++ b/internal/core/unittest/test_growing_index.cpp @@ -101,7 +101,9 @@ TEST(GrowingIndex, Correctness) { *schema, plan_str.data(), plan_str.size()); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + + Timestamp timestamp = 1000000; + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); EXPECT_EQ(sr->total_nq_, num_queries); EXPECT_EQ(sr->unity_topK_, top_k); EXPECT_EQ(sr->distances_.size(), num_queries * top_k); @@ -111,7 +113,8 @@ TEST(GrowingIndex, Correctness) { *schema, range_plan_str.data(), range_plan_str.size()); auto range_ph_group = ParsePlaceholderGroup( range_plan.get(), ph_group_raw.SerializeAsString()); - auto range_sr = segment->Search(range_plan.get(), range_ph_group.get()); + auto range_sr = + segment->Search(range_plan.get(), range_ph_group.get(), timestamp); ASSERT_EQ(range_sr->total_nq_, num_queries); EXPECT_EQ(sr->unity_topK_, top_k); EXPECT_EQ(sr->distances_.size(), num_queries * top_k); diff --git a/internal/core/unittest/test_query.cpp b/internal/core/unittest/test_query.cpp index 97fba1187ba31..2e0223126935b 100644 --- a/internal/core/unittest/test_query.cpp +++ b/internal/core/unittest/test_query.cpp @@ -128,8 +128,9 @@ TEST(Query, ExecWithPredicateLoader) { auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); query::Json json = SearchResultToJson(*sr); #ifdef __linux__ @@ -212,7 +213,9 @@ TEST(Query, ExecWithPredicateSmallN) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + Timestamp timestamp = 1000000; + + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); query::Json json = SearchResultToJson(*sr); std::cout << json.dump(2); @@ -270,8 +273,9 @@ TEST(Query, ExecWithPredicate) { auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); query::Json json = SearchResultToJson(*sr); #ifdef __linux__ @@ -351,8 +355,9 @@ TEST(Query, ExecTerm) { auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); int topk = 5; auto json = SearchResultToJson(*sr); ASSERT_EQ(sr->total_nq_, num_queries); @@ -386,7 +391,8 @@ TEST(Query, ExecEmpty) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + Timestamp timestamp = 1000000; + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); std::cout << SearchResultToJson(*sr); ASSERT_EQ(sr->unity_topK_, 0); @@ -434,8 +440,8 @@ TEST(Query, ExecWithoutPredicateFlat) { auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - - auto sr = segment->Search(plan.get(), ph_group.get()); + Timestamp timestamp = 1000000; + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); std::vector> results; auto json = SearchResultToJson(*sr); std::cout << json.dump(2); @@ -477,8 +483,9 @@ TEST(Query, ExecWithoutPredicate) { auto ph_group_raw = CreatePlaceholderGroup(num_queries, 16, 1024); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); assert_order(*sr, "l2"); std::vector> results; auto json = SearchResultToJson(*sr); @@ -546,7 +553,9 @@ TEST(Query, InnerProduct) { CreatePlaceholderGroupFromBlob(num_queries, 16, col.data()); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + + Timestamp ts = N * 2; + auto sr = segment->Search(plan.get(), ph_group.get(), ts); assert_order(*sr, "ip"); } @@ -633,6 +642,8 @@ TEST(Query, FillSegment) { CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); auto ph_proto = CreatePlaceholderGroup(10, 16, 443); auto ph = ParsePlaceholderGroup(plan.get(), ph_proto.SerializeAsString()); + Timestamp ts = N * 2UL; + auto topk = 5; auto num_queries = 10; @@ -642,7 +653,7 @@ TEST(Query, FillSegment) { schema->get_field_id(FieldName("fakevec"))); plan->target_entries_.push_back( schema->get_field_id(FieldName("the_value"))); - auto result = segment->Search(plan.get(), ph.get()); + auto result = segment->Search(plan.get(), ph.get(), ts); result->result_offsets_.resize(topk * num_queries); segment->FillTargetEntry(plan.get(), *result); segment->FillPrimaryKeys(plan.get(), *result); @@ -746,7 +757,9 @@ TEST(Query, ExecWithPredicateBinary) { num_queries, 512, vec_ptr.data() + 1024 * 512 / 8); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto sr = segment->Search(plan.get(), ph_group.get()); + + Timestamp timestamp = 1000000; + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); query::Json json = SearchResultToJson(*sr); std::cout << json.dump(2); diff --git a/internal/core/unittest/test_sealed.cpp b/internal/core/unittest/test_sealed.cpp index e768dfe08a355..9361408385768 100644 --- a/internal/core/unittest/test_sealed.cpp +++ b/internal/core/unittest/test_sealed.cpp @@ -80,10 +80,11 @@ TEST(Sealed, without_predicate) { CreatePlaceholderGroupFromBlob(num_queries, 16, query_ptr); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; std::vector ph_group_arr = {ph_group.get()}; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); auto pre_result = SearchResultToJson(*sr); milvus::index::CreateIndexInfo create_index_info; create_index_info.field_type = DataType::VECTOR_FLOAT; @@ -127,7 +128,7 @@ TEST(Sealed, without_predicate) { sealed_segment->DropFieldData(fake_id); sealed_segment->LoadIndex(load_info); - sr = sealed_segment->Search(plan.get(), ph_group.get()); + sr = sealed_segment->Search(plan.get(), ph_group.get(), timestamp); auto post_result = SearchResultToJson(*sr); std::cout << "ref_result" << std::endl; @@ -135,6 +136,9 @@ TEST(Sealed, without_predicate) { std::cout << "post_result" << std::endl; std::cout << post_result.dump(1); // ASSERT_EQ(ref_result.dump(1), post_result.dump(1)); + + sr = sealed_segment->Search(plan.get(), ph_group.get(), 0); + EXPECT_EQ(sr->get_total_result_count(), 0); } TEST(Sealed, with_predicate) { @@ -196,10 +200,11 @@ TEST(Sealed, with_predicate) { CreatePlaceholderGroupFromBlob(num_queries, 16, query_ptr); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; std::vector ph_group_arr = {ph_group.get()}; - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); milvus::index::CreateIndexInfo create_index_info; create_index_info.field_type = DataType::VECTOR_FLOAT; create_index_info.metric_type = knowhere::metric::L2; @@ -242,7 +247,7 @@ TEST(Sealed, with_predicate) { sealed_segment->DropFieldData(fake_id); sealed_segment->LoadIndex(load_info); - sr = sealed_segment->Search(plan.get(), ph_group.get()); + sr = sealed_segment->Search(plan.get(), ph_group.get(), timestamp); for (int i = 0; i < num_queries; ++i) { auto offset = i * topK; @@ -303,6 +308,7 @@ TEST(Sealed, with_predicate_filter_all) { CreatePlaceholderGroupFromBlob(num_queries, 16, query_ptr); auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); + Timestamp timestamp = 1000000; std::vector ph_group_arr = {ph_group.get()}; @@ -337,7 +343,7 @@ TEST(Sealed, with_predicate_filter_all) { ivf_sealed_segment->DropFieldData(fake_id); ivf_sealed_segment->LoadIndex(load_info); - auto sr = ivf_sealed_segment->Search(plan.get(), ph_group.get()); + auto sr = ivf_sealed_segment->Search(plan.get(), ph_group.get(), timestamp); EXPECT_EQ(sr->unity_topK_, 0); EXPECT_EQ(sr->get_total_result_count(), 0); @@ -372,7 +378,8 @@ TEST(Sealed, with_predicate_filter_all) { hnsw_sealed_segment->DropFieldData(fake_id); hnsw_sealed_segment->LoadIndex(hnsw_load_info); - auto sr2 = hnsw_sealed_segment->Search(plan.get(), ph_group.get()); + auto sr2 = + hnsw_sealed_segment->Search(plan.get(), ph_group.get(), timestamp); EXPECT_EQ(sr2->unity_topK_, 0); EXPECT_EQ(sr2->get_total_result_count(), 0); } @@ -400,7 +407,8 @@ TEST(Sealed, LoadFieldData) { auto fakevec = dataset.get_col(fakevec_id); - auto indexing = GenVecIndexing(N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); + auto indexing = GenVecIndexing( + N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); auto segment = CreateSealedSegment(schema); // std::string dsl = R"({ @@ -456,7 +464,7 @@ TEST(Sealed, LoadFieldData) { > placeholder_tag: "$0" >)"; - + Timestamp timestamp = 1000000; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); @@ -465,13 +473,13 @@ TEST(Sealed, LoadFieldData) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); SealedLoadFieldData(dataset, *segment); - segment->Search(plan.get(), ph_group.get()); + segment->Search(plan.get(), ph_group.get(), timestamp); segment->DropFieldData(fakevec_id); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); LoadIndexInfo vec_info; vec_info.field_id = fakevec_id.get(); @@ -494,12 +502,12 @@ TEST(Sealed, LoadFieldData) { ASSERT_EQ(chunk_span3[i], ref3[i]); } - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); auto json = SearchResultToJson(*sr); std::cout << json.dump(1); segment->DropIndex(fakevec_id); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); } TEST(Sealed, LoadFieldDataMmap) { @@ -525,7 +533,8 @@ TEST(Sealed, LoadFieldDataMmap) { auto fakevec = dataset.get_col(fakevec_id); - auto indexing = GenVecIndexing(N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); + auto indexing = GenVecIndexing( + N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); auto segment = CreateSealedSegment(schema); const char* raw_plan = R"(vector_anns: < @@ -554,7 +563,7 @@ TEST(Sealed, LoadFieldDataMmap) { > placeholder_tag: "$0" >)"; - + Timestamp timestamp = 1000000; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); @@ -563,13 +572,13 @@ TEST(Sealed, LoadFieldDataMmap) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); SealedLoadFieldData(dataset, *segment, {}, true); - segment->Search(plan.get(), ph_group.get()); + segment->Search(plan.get(), ph_group.get(), timestamp); segment->DropFieldData(fakevec_id); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); LoadIndexInfo vec_info; vec_info.field_id = fakevec_id.get(); @@ -592,12 +601,12 @@ TEST(Sealed, LoadFieldDataMmap) { ASSERT_EQ(chunk_span3[i], ref3[i]); } - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); auto json = SearchResultToJson(*sr); std::cout << json.dump(1); segment->DropIndex(fakevec_id); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); } TEST(Sealed, LoadScalarIndex) { @@ -616,7 +625,8 @@ TEST(Sealed, LoadScalarIndex) { auto fakevec = dataset.get_col(fakevec_id); - auto indexing = GenVecIndexing(N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); + auto indexing = GenVecIndexing( + N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); auto segment = CreateSealedSegment(schema); // std::string dsl = R"({ @@ -672,7 +682,7 @@ TEST(Sealed, LoadScalarIndex) { > placeholder_tag: "$0" >)"; - + Timestamp timestamp = 1000000; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); @@ -731,7 +741,7 @@ TEST(Sealed, LoadScalarIndex) { nothing_index.index = GenScalarIndexing(N, nothing_data.data()); segment->LoadIndex(nothing_index); - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), timestamp); auto json = SearchResultToJson(*sr); std::cout << json.dump(1); } @@ -780,7 +790,7 @@ TEST(Sealed, Delete) { > placeholder_tag: "$0" >)"; - + Timestamp timestamp = 1000000; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); @@ -789,7 +799,7 @@ TEST(Sealed, Delete) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); SealedLoadFieldData(dataset, *segment); @@ -864,7 +874,7 @@ TEST(Sealed, OverlapDelete) { > placeholder_tag: "$0" >)"; - + Timestamp timestamp = 1000000; auto plan_str = translate_text_plan_to_binary_plan(raw_plan); auto plan = CreateSearchPlanByExpr(*schema, plan_str.data(), plan_str.size()); @@ -873,7 +883,7 @@ TEST(Sealed, OverlapDelete) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get())); + ASSERT_ANY_THROW(segment->Search(plan.get(), ph_group.get(), timestamp)); SealedLoadFieldData(dataset, *segment); @@ -991,7 +1001,7 @@ TEST(Sealed, BF) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto result = segment->Search(plan.get(), ph_group.get()); + auto result = segment->Search(plan.get(), ph_group.get(), MAX_TIMESTAMP); auto ves = SearchResultToVector(*result); // first: offset, second: distance EXPECT_GE(ves[0].first, 0); @@ -1045,7 +1055,7 @@ TEST(Sealed, BF_Overflow) { auto ph_group = ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); - auto result = segment->Search(plan.get(), ph_group.get()); + auto result = segment->Search(plan.get(), ph_group.get(), MAX_TIMESTAMP); auto ves = SearchResultToVector(*result); for (int i = 0; i < num_queries; ++i) { EXPECT_EQ(ves[0].first, -1); @@ -1135,7 +1145,8 @@ TEST(Sealed, GetVector) { auto fakevec = dataset.get_col(fakevec_id); - auto indexing = GenVecIndexing(N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); + auto indexing = GenVecIndexing( + N, dim, fakevec.data(), knowhere::IndexEnum::INDEX_FAISS_IVFFLAT); auto segment_sealed = CreateSealedSegment(schema); @@ -1322,7 +1333,7 @@ TEST(Sealed, LoadArrayFieldData) { ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); SealedLoadFieldData(dataset, *segment); - segment->Search(plan.get(), ph_group.get()); + segment->Search(plan.get(), ph_group.get(), 1L << 63); auto ids_ds = GenRandomIds(N); auto s = dynamic_cast(segment.get()); @@ -1379,7 +1390,7 @@ TEST(Sealed, LoadArrayFieldDataWithMMap) { ParsePlaceholderGroup(plan.get(), ph_group_raw.SerializeAsString()); SealedLoadFieldData(dataset, *segment, {}, true); - segment->Search(plan.get(), ph_group.get()); + segment->Search(plan.get(), ph_group.get(), 1L << 63); } TEST(Sealed, SkipIndexSkipUnaryRange) { diff --git a/internal/core/unittest/test_string_expr.cpp b/internal/core/unittest/test_string_expr.cpp index c20c2665e7083..127c63ff38598 100644 --- a/internal/core/unittest/test_string_expr.cpp +++ b/internal/core/unittest/test_string_expr.cpp @@ -726,7 +726,7 @@ TEST(AlwaysTrueStringPlan, SearchWithOutputFields) { auto sub_result = BruteForceSearch( search_dataset, vec_col.data(), N, knowhere::Json(), nullptr); - auto sr = segment->Search(plan.get(), ph_group.get()); + auto sr = segment->Search(plan.get(), ph_group.get(), MAX_TIMESTAMP); segment->FillPrimaryKeys(plan.get(), *sr); segment->FillTargetEntry(plan.get(), *sr); ASSERT_EQ(sr->pk_type_, DataType::VARCHAR); diff --git a/internal/core/unittest/test_utils/DataGen.h b/internal/core/unittest/test_utils/DataGen.h index 6b24b0aa2c978..0f5d13a3b62b3 100644 --- a/internal/core/unittest/test_utils/DataGen.h +++ b/internal/core/unittest/test_utils/DataGen.h @@ -904,7 +904,10 @@ SealedCreator(SchemaPtr schema, const GeneratedData& dataset) { } inline std::unique_ptr -GenVecIndexing(int64_t N, int64_t dim, const float* vec, const char* index_type) { +GenVecIndexing(int64_t N, + int64_t dim, + const float* vec, + const char* index_type) { auto conf = knowhere::Json{{knowhere::meta::METRIC_TYPE, knowhere::metric::L2}, {knowhere::meta::DIM, std::to_string(dim)}, 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 6c46fea2e92a9..e57cb2615eb6d 100644 --- a/internal/core/unittest/test_utils/c_api_test_utils.h +++ b/internal/core/unittest/test_utils/c_api_test_utils.h @@ -37,9 +37,9 @@ using namespace milvus; using namespace milvus::segcore; namespace { - const char* - get_default_schema_config() { - static std::string conf = R"(name: "default-collection" +const char* +get_default_schema_config() { + static std::string conf = R"(name: "default-collection" fields: < fieldID: 100 name: "fakevec" @@ -59,81 +59,81 @@ namespace { data_type: Int64 is_primary_key: true >)"; - static std::string fake_conf = ""; - return conf.c_str(); - } + static std::string fake_conf = ""; + return conf.c_str(); +} - std::string - generate_max_float_query_data(int all_nq, int max_float_nq) { - assert(max_float_nq <= all_nq); - namespace ser = milvus::proto::common; - int dim = DIM; - ser::PlaceholderGroup raw_group; - auto value = raw_group.add_placeholders(); - value->set_tag("$0"); - value->set_type(ser::PlaceholderType::FloatVector); - for (int i = 0; i < all_nq; ++i) { - std::vector vec; - if (i < max_float_nq) { - for (int d = 0; d < dim; ++d) { - vec.push_back(std::numeric_limits::max()); - } - } else { - for (int d = 0; d < dim; ++d) { - vec.push_back(1); - } +std::string +generate_max_float_query_data(int all_nq, int max_float_nq) { + assert(max_float_nq <= all_nq); + namespace ser = milvus::proto::common; + int dim = DIM; + ser::PlaceholderGroup raw_group; + auto value = raw_group.add_placeholders(); + value->set_tag("$0"); + value->set_type(ser::PlaceholderType::FloatVector); + for (int i = 0; i < all_nq; ++i) { + std::vector vec; + if (i < max_float_nq) { + for (int d = 0; d < dim; ++d) { + vec.push_back(std::numeric_limits::max()); } - value->add_values(vec.data(), vec.size() * sizeof(float)); - } - auto blob = raw_group.SerializeAsString(); - return blob; - } - std::string - generate_query_data(int nq) { - namespace ser = milvus::proto::common; - std::default_random_engine e(67); - int dim = DIM; - std::normal_distribution dis(0.0, 1.0); - ser::PlaceholderGroup raw_group; - auto value = raw_group.add_placeholders(); - value->set_tag("$0"); - value->set_type(ser::PlaceholderType::FloatVector); - for (int i = 0; i < nq; ++i) { - std::vector vec; + } else { for (int d = 0; d < dim; ++d) { - vec.push_back(dis(e)); + vec.push_back(1); } - value->add_values(vec.data(), vec.size() * sizeof(float)); } - auto blob = raw_group.SerializeAsString(); - return blob; + value->add_values(vec.data(), vec.size() * sizeof(float)); } - void - CheckSearchResultDuplicate(const std::vector& results) { - auto nq = ((SearchResult*)results[0])->total_nq_; + auto blob = raw_group.SerializeAsString(); + return blob; +} +std::string +generate_query_data(int nq) { + namespace ser = milvus::proto::common; + std::default_random_engine e(67); + int dim = DIM; + std::normal_distribution dis(0.0, 1.0); + ser::PlaceholderGroup raw_group; + auto value = raw_group.add_placeholders(); + value->set_tag("$0"); + value->set_type(ser::PlaceholderType::FloatVector); + for (int i = 0; i < nq; ++i) { + std::vector vec; + for (int d = 0; d < dim; ++d) { + vec.push_back(dis(e)); + } + value->add_values(vec.data(), vec.size() * sizeof(float)); + } + auto blob = raw_group.SerializeAsString(); + return blob; +} +void +CheckSearchResultDuplicate(const std::vector& results) { + auto nq = ((SearchResult*)results[0])->total_nq_; - std::unordered_set pk_set; - std::unordered_set group_by_val_set; - for (int qi = 0; qi < nq; qi++) { - pk_set.clear(); - group_by_val_set.clear(); - for (size_t i = 0; i < results.size(); i++) { - auto search_result = (SearchResult*)results[i]; - ASSERT_EQ(nq, search_result->total_nq_); - auto topk_beg = search_result->topk_per_nq_prefix_sum_[qi]; - auto topk_end = search_result->topk_per_nq_prefix_sum_[qi + 1]; - for (size_t ki = topk_beg; ki < topk_end; ki++) { - ASSERT_NE(search_result->seg_offsets_[ki], INVALID_SEG_OFFSET); - auto ret = pk_set.insert(search_result->primary_keys_[ki]); - ASSERT_TRUE(ret.second); + std::unordered_set pk_set; + std::unordered_set group_by_val_set; + for (int qi = 0; qi < nq; qi++) { + pk_set.clear(); + group_by_val_set.clear(); + for (size_t i = 0; i < results.size(); i++) { + auto search_result = (SearchResult*)results[i]; + ASSERT_EQ(nq, search_result->total_nq_); + auto topk_beg = search_result->topk_per_nq_prefix_sum_[qi]; + auto topk_end = search_result->topk_per_nq_prefix_sum_[qi + 1]; + for (size_t ki = topk_beg; ki < topk_end; ki++) { + ASSERT_NE(search_result->seg_offsets_[ki], INVALID_SEG_OFFSET); + auto ret = pk_set.insert(search_result->primary_keys_[ki]); + ASSERT_TRUE(ret.second); - if(search_result->group_by_values_.size()>ki){ - auto group_by_val = search_result->group_by_values_[ki]; - ASSERT_TRUE(group_by_val_set.count(group_by_val)==0); - group_by_val_set.insert(group_by_val); - } + if (search_result->group_by_values_.size() > ki) { + auto group_by_val = search_result->group_by_values_[ki]; + ASSERT_TRUE(group_by_val_set.count(group_by_val) == 0); + group_by_val_set.insert(group_by_val); } } } } } +} // namespace diff --git a/internal/proto/internal.proto b/internal/proto/internal.proto index 9f768a7796594..a3cee9652f840 100644 --- a/internal/proto/internal.proto +++ b/internal/proto/internal.proto @@ -94,6 +94,7 @@ message SearchRequest { common.DslType dsl_type = 8; bytes serialized_expr_plan = 9; repeated int64 output_fields_id = 10; + uint64 mvcc_timestamp = 11; uint64 guarantee_timestamp = 12; uint64 timeout_timestamp = 13; int64 nq = 14; @@ -120,6 +121,7 @@ message SearchResults { // search request cost CostAggregation costAggregation = 13; + map channels_mvcc = 14; } message CostAggregation { @@ -160,7 +162,7 @@ message RetrieveResults { repeated int64 global_sealed_segmentIDs = 8; // query request cost - CostAggregation costAggregation = 13; + CostAggregation costAggregation = 13; } message LoadIndex { diff --git a/internal/proto/internalpb/internal.pb.go~parent of ca1349708... Remove time travel ralted testcase (#26119) b/internal/proto/internalpb/internal.pb.go~parent of ca1349708... Remove time travel ralted testcase (#26119) new file mode 100644 index 0000000000000..65268d2d6e002 --- /dev/null +++ b/internal/proto/internalpb/internal.pb.go~parent of ca1349708... Remove time travel ralted testcase (#26119) @@ -0,0 +1,2132 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: internal.proto + +package internalpb + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" + schemapb "github.com/milvus-io/milvus-proto/go-api/v2/schemapb" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type RateType int32 + +const ( + RateType_DDLCollection RateType = 0 + RateType_DDLPartition RateType = 1 + RateType_DDLIndex RateType = 2 + RateType_DDLFlush RateType = 3 + RateType_DDLCompaction RateType = 4 + RateType_DMLInsert RateType = 5 + RateType_DMLDelete RateType = 6 + RateType_DMLBulkLoad RateType = 7 + RateType_DQLSearch RateType = 8 + RateType_DQLQuery RateType = 9 + RateType_DMLUpsert RateType = 10 +) + +var RateType_name = map[int32]string{ + 0: "DDLCollection", + 1: "DDLPartition", + 2: "DDLIndex", + 3: "DDLFlush", + 4: "DDLCompaction", + 5: "DMLInsert", + 6: "DMLDelete", + 7: "DMLBulkLoad", + 8: "DQLSearch", + 9: "DQLQuery", + 10: "DMLUpsert", +} + +var RateType_value = map[string]int32{ + "DDLCollection": 0, + "DDLPartition": 1, + "DDLIndex": 2, + "DDLFlush": 3, + "DDLCompaction": 4, + "DMLInsert": 5, + "DMLDelete": 6, + "DMLBulkLoad": 7, + "DQLSearch": 8, + "DQLQuery": 9, + "DMLUpsert": 10, +} + +func (x RateType) String() string { + return proto.EnumName(RateType_name, int32(x)) +} + +func (RateType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{0} +} + +type GetTimeTickChannelRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetTimeTickChannelRequest) Reset() { *m = GetTimeTickChannelRequest{} } +func (m *GetTimeTickChannelRequest) String() string { return proto.CompactTextString(m) } +func (*GetTimeTickChannelRequest) ProtoMessage() {} +func (*GetTimeTickChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{0} +} + +func (m *GetTimeTickChannelRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetTimeTickChannelRequest.Unmarshal(m, b) +} +func (m *GetTimeTickChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetTimeTickChannelRequest.Marshal(b, m, deterministic) +} +func (m *GetTimeTickChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTimeTickChannelRequest.Merge(m, src) +} +func (m *GetTimeTickChannelRequest) XXX_Size() int { + return xxx_messageInfo_GetTimeTickChannelRequest.Size(m) +} +func (m *GetTimeTickChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetTimeTickChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTimeTickChannelRequest proto.InternalMessageInfo + +type GetStatisticsChannelRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetStatisticsChannelRequest) Reset() { *m = GetStatisticsChannelRequest{} } +func (m *GetStatisticsChannelRequest) String() string { return proto.CompactTextString(m) } +func (*GetStatisticsChannelRequest) ProtoMessage() {} +func (*GetStatisticsChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{1} +} + +func (m *GetStatisticsChannelRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetStatisticsChannelRequest.Unmarshal(m, b) +} +func (m *GetStatisticsChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetStatisticsChannelRequest.Marshal(b, m, deterministic) +} +func (m *GetStatisticsChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetStatisticsChannelRequest.Merge(m, src) +} +func (m *GetStatisticsChannelRequest) XXX_Size() int { + return xxx_messageInfo_GetStatisticsChannelRequest.Size(m) +} +func (m *GetStatisticsChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetStatisticsChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetStatisticsChannelRequest proto.InternalMessageInfo + +type GetDdChannelRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDdChannelRequest) Reset() { *m = GetDdChannelRequest{} } +func (m *GetDdChannelRequest) String() string { return proto.CompactTextString(m) } +func (*GetDdChannelRequest) ProtoMessage() {} +func (*GetDdChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{2} +} + +func (m *GetDdChannelRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDdChannelRequest.Unmarshal(m, b) +} +func (m *GetDdChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDdChannelRequest.Marshal(b, m, deterministic) +} +func (m *GetDdChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDdChannelRequest.Merge(m, src) +} +func (m *GetDdChannelRequest) XXX_Size() int { + return xxx_messageInfo_GetDdChannelRequest.Size(m) +} +func (m *GetDdChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDdChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDdChannelRequest proto.InternalMessageInfo + +type NodeInfo struct { + Address *commonpb.Address `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NodeInfo) Reset() { *m = NodeInfo{} } +func (m *NodeInfo) String() string { return proto.CompactTextString(m) } +func (*NodeInfo) ProtoMessage() {} +func (*NodeInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{3} +} + +func (m *NodeInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NodeInfo.Unmarshal(m, b) +} +func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NodeInfo.Marshal(b, m, deterministic) +} +func (m *NodeInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_NodeInfo.Merge(m, src) +} +func (m *NodeInfo) XXX_Size() int { + return xxx_messageInfo_NodeInfo.Size(m) +} +func (m *NodeInfo) XXX_DiscardUnknown() { + xxx_messageInfo_NodeInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_NodeInfo proto.InternalMessageInfo + +func (m *NodeInfo) GetAddress() *commonpb.Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *NodeInfo) GetRole() string { + if m != nil { + return m.Role + } + return "" +} + +type InitParams struct { + NodeID int64 `protobuf:"varint,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"` + StartParams []*commonpb.KeyValuePair `protobuf:"bytes,2,rep,name=start_params,json=startParams,proto3" json:"start_params,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InitParams) Reset() { *m = InitParams{} } +func (m *InitParams) String() string { return proto.CompactTextString(m) } +func (*InitParams) ProtoMessage() {} +func (*InitParams) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{4} +} + +func (m *InitParams) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InitParams.Unmarshal(m, b) +} +func (m *InitParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InitParams.Marshal(b, m, deterministic) +} +func (m *InitParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitParams.Merge(m, src) +} +func (m *InitParams) XXX_Size() int { + return xxx_messageInfo_InitParams.Size(m) +} +func (m *InitParams) XXX_DiscardUnknown() { + xxx_messageInfo_InitParams.DiscardUnknown(m) +} + +var xxx_messageInfo_InitParams proto.InternalMessageInfo + +func (m *InitParams) GetNodeID() int64 { + if m != nil { + return m.NodeID + } + return 0 +} + +func (m *InitParams) GetStartParams() []*commonpb.KeyValuePair { + if m != nil { + return m.StartParams + } + return nil +} + +type StringList struct { + Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + Status *commonpb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StringList) Reset() { *m = StringList{} } +func (m *StringList) String() string { return proto.CompactTextString(m) } +func (*StringList) ProtoMessage() {} +func (*StringList) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{5} +} + +func (m *StringList) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StringList.Unmarshal(m, b) +} +func (m *StringList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StringList.Marshal(b, m, deterministic) +} +func (m *StringList) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringList.Merge(m, src) +} +func (m *StringList) XXX_Size() int { + return xxx_messageInfo_StringList.Size(m) +} +func (m *StringList) XXX_DiscardUnknown() { + xxx_messageInfo_StringList.DiscardUnknown(m) +} + +var xxx_messageInfo_StringList proto.InternalMessageInfo + +func (m *StringList) GetValues() []string { + if m != nil { + return m.Values + } + return nil +} + +func (m *StringList) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +type GetStatisticsRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + // Not useful for now + DbID int64 `protobuf:"varint,2,opt,name=dbID,proto3" json:"dbID,omitempty"` + // The collection you want get statistics + CollectionID int64 `protobuf:"varint,3,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + // The partitions you want get statistics + PartitionIDs []int64 `protobuf:"varint,4,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"` + // timestamp of the statistics + TravelTimestamp uint64 `protobuf:"varint,5,opt,name=travel_timestamp,json=travelTimestamp,proto3" json:"travel_timestamp,omitempty"` + GuaranteeTimestamp uint64 `protobuf:"varint,6,opt,name=guarantee_timestamp,json=guaranteeTimestamp,proto3" json:"guarantee_timestamp,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,7,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetStatisticsRequest) Reset() { *m = GetStatisticsRequest{} } +func (m *GetStatisticsRequest) String() string { return proto.CompactTextString(m) } +func (*GetStatisticsRequest) ProtoMessage() {} +func (*GetStatisticsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{6} +} + +func (m *GetStatisticsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetStatisticsRequest.Unmarshal(m, b) +} +func (m *GetStatisticsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetStatisticsRequest.Marshal(b, m, deterministic) +} +func (m *GetStatisticsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetStatisticsRequest.Merge(m, src) +} +func (m *GetStatisticsRequest) XXX_Size() int { + return xxx_messageInfo_GetStatisticsRequest.Size(m) +} +func (m *GetStatisticsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetStatisticsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetStatisticsRequest proto.InternalMessageInfo + +func (m *GetStatisticsRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *GetStatisticsRequest) GetDbID() int64 { + if m != nil { + return m.DbID + } + return 0 +} + +func (m *GetStatisticsRequest) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *GetStatisticsRequest) GetPartitionIDs() []int64 { + if m != nil { + return m.PartitionIDs + } + return nil +} + +func (m *GetStatisticsRequest) GetTravelTimestamp() uint64 { + if m != nil { + return m.TravelTimestamp + } + return 0 +} + +func (m *GetStatisticsRequest) GetGuaranteeTimestamp() uint64 { + if m != nil { + return m.GuaranteeTimestamp + } + return 0 +} + +func (m *GetStatisticsRequest) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +type GetStatisticsResponse struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + // Contain error_code and reason + Status *commonpb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + // Collection statistics data. Contain pairs like {"row_count": "1"} + Stats []*commonpb.KeyValuePair `protobuf:"bytes,3,rep,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetStatisticsResponse) Reset() { *m = GetStatisticsResponse{} } +func (m *GetStatisticsResponse) String() string { return proto.CompactTextString(m) } +func (*GetStatisticsResponse) ProtoMessage() {} +func (*GetStatisticsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{7} +} + +func (m *GetStatisticsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetStatisticsResponse.Unmarshal(m, b) +} +func (m *GetStatisticsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetStatisticsResponse.Marshal(b, m, deterministic) +} +func (m *GetStatisticsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetStatisticsResponse.Merge(m, src) +} +func (m *GetStatisticsResponse) XXX_Size() int { + return xxx_messageInfo_GetStatisticsResponse.Size(m) +} +func (m *GetStatisticsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetStatisticsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetStatisticsResponse proto.InternalMessageInfo + +func (m *GetStatisticsResponse) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *GetStatisticsResponse) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *GetStatisticsResponse) GetStats() []*commonpb.KeyValuePair { + if m != nil { + return m.Stats + } + return nil +} + +type CreateAliasRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + CollectionName string `protobuf:"bytes,3,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + Alias string `protobuf:"bytes,4,opt,name=alias,proto3" json:"alias,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateAliasRequest) Reset() { *m = CreateAliasRequest{} } +func (m *CreateAliasRequest) String() string { return proto.CompactTextString(m) } +func (*CreateAliasRequest) ProtoMessage() {} +func (*CreateAliasRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{8} +} + +func (m *CreateAliasRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateAliasRequest.Unmarshal(m, b) +} +func (m *CreateAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateAliasRequest.Marshal(b, m, deterministic) +} +func (m *CreateAliasRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateAliasRequest.Merge(m, src) +} +func (m *CreateAliasRequest) XXX_Size() int { + return xxx_messageInfo_CreateAliasRequest.Size(m) +} +func (m *CreateAliasRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateAliasRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateAliasRequest proto.InternalMessageInfo + +func (m *CreateAliasRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *CreateAliasRequest) GetDbName() string { + if m != nil { + return m.DbName + } + return "" +} + +func (m *CreateAliasRequest) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *CreateAliasRequest) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +type DropAliasRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DropAliasRequest) Reset() { *m = DropAliasRequest{} } +func (m *DropAliasRequest) String() string { return proto.CompactTextString(m) } +func (*DropAliasRequest) ProtoMessage() {} +func (*DropAliasRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{9} +} + +func (m *DropAliasRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DropAliasRequest.Unmarshal(m, b) +} +func (m *DropAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DropAliasRequest.Marshal(b, m, deterministic) +} +func (m *DropAliasRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DropAliasRequest.Merge(m, src) +} +func (m *DropAliasRequest) XXX_Size() int { + return xxx_messageInfo_DropAliasRequest.Size(m) +} +func (m *DropAliasRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DropAliasRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DropAliasRequest proto.InternalMessageInfo + +func (m *DropAliasRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *DropAliasRequest) GetDbName() string { + if m != nil { + return m.DbName + } + return "" +} + +func (m *DropAliasRequest) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +type AlterAliasRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + CollectionName string `protobuf:"bytes,3,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + Alias string `protobuf:"bytes,4,opt,name=alias,proto3" json:"alias,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AlterAliasRequest) Reset() { *m = AlterAliasRequest{} } +func (m *AlterAliasRequest) String() string { return proto.CompactTextString(m) } +func (*AlterAliasRequest) ProtoMessage() {} +func (*AlterAliasRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{10} +} + +func (m *AlterAliasRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AlterAliasRequest.Unmarshal(m, b) +} +func (m *AlterAliasRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AlterAliasRequest.Marshal(b, m, deterministic) +} +func (m *AlterAliasRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AlterAliasRequest.Merge(m, src) +} +func (m *AlterAliasRequest) XXX_Size() int { + return xxx_messageInfo_AlterAliasRequest.Size(m) +} +func (m *AlterAliasRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AlterAliasRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AlterAliasRequest proto.InternalMessageInfo + +func (m *AlterAliasRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *AlterAliasRequest) GetDbName() string { + if m != nil { + return m.DbName + } + return "" +} + +func (m *AlterAliasRequest) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *AlterAliasRequest) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +type CreateIndexRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + CollectionName string `protobuf:"bytes,3,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + FieldName string `protobuf:"bytes,4,opt,name=field_name,json=fieldName,proto3" json:"field_name,omitempty"` + DbID int64 `protobuf:"varint,5,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionID int64 `protobuf:"varint,6,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + FieldID int64 `protobuf:"varint,7,opt,name=fieldID,proto3" json:"fieldID,omitempty"` + ExtraParams []*commonpb.KeyValuePair `protobuf:"bytes,8,rep,name=extra_params,json=extraParams,proto3" json:"extra_params,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateIndexRequest) Reset() { *m = CreateIndexRequest{} } +func (m *CreateIndexRequest) String() string { return proto.CompactTextString(m) } +func (*CreateIndexRequest) ProtoMessage() {} +func (*CreateIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{11} +} + +func (m *CreateIndexRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateIndexRequest.Unmarshal(m, b) +} +func (m *CreateIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateIndexRequest.Marshal(b, m, deterministic) +} +func (m *CreateIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateIndexRequest.Merge(m, src) +} +func (m *CreateIndexRequest) XXX_Size() int { + return xxx_messageInfo_CreateIndexRequest.Size(m) +} +func (m *CreateIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CreateIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateIndexRequest proto.InternalMessageInfo + +func (m *CreateIndexRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *CreateIndexRequest) GetDbName() string { + if m != nil { + return m.DbName + } + return "" +} + +func (m *CreateIndexRequest) GetCollectionName() string { + if m != nil { + return m.CollectionName + } + return "" +} + +func (m *CreateIndexRequest) GetFieldName() string { + if m != nil { + return m.FieldName + } + return "" +} + +func (m *CreateIndexRequest) GetDbID() int64 { + if m != nil { + return m.DbID + } + return 0 +} + +func (m *CreateIndexRequest) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *CreateIndexRequest) GetFieldID() int64 { + if m != nil { + return m.FieldID + } + return 0 +} + +func (m *CreateIndexRequest) GetExtraParams() []*commonpb.KeyValuePair { + if m != nil { + return m.ExtraParams + } + return nil +} + +type SearchRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + ReqID int64 `protobuf:"varint,2,opt,name=reqID,proto3" json:"reqID,omitempty"` + DbID int64 `protobuf:"varint,3,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionID int64 `protobuf:"varint,4,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + PartitionIDs []int64 `protobuf:"varint,5,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"` + Dsl string `protobuf:"bytes,6,opt,name=dsl,proto3" json:"dsl,omitempty"` + // serialized `PlaceholderGroup` + PlaceholderGroup []byte `protobuf:"bytes,7,opt,name=placeholder_group,json=placeholderGroup,proto3" json:"placeholder_group,omitempty"` + DslType commonpb.DslType `protobuf:"varint,8,opt,name=dsl_type,json=dslType,proto3,enum=milvus.proto.common.DslType" json:"dsl_type,omitempty"` + SerializedExprPlan []byte `protobuf:"bytes,9,opt,name=serialized_expr_plan,json=serializedExprPlan,proto3" json:"serialized_expr_plan,omitempty"` + OutputFieldsId []int64 `protobuf:"varint,10,rep,packed,name=output_fields_id,json=outputFieldsId,proto3" json:"output_fields_id,omitempty"` + TravelTimestamp uint64 `protobuf:"varint,11,opt,name=travel_timestamp,json=travelTimestamp,proto3" json:"travel_timestamp,omitempty"` + GuaranteeTimestamp uint64 `protobuf:"varint,12,opt,name=guarantee_timestamp,json=guaranteeTimestamp,proto3" json:"guarantee_timestamp,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,13,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + Nq int64 `protobuf:"varint,14,opt,name=nq,proto3" json:"nq,omitempty"` + Topk int64 `protobuf:"varint,15,opt,name=topk,proto3" json:"topk,omitempty"` + MetricType string `protobuf:"bytes,16,opt,name=metricType,proto3" json:"metricType,omitempty"` + IgnoreGrowing bool `protobuf:"varint,17,opt,name=ignoreGrowing,proto3" json:"ignoreGrowing,omitempty"` + Username string `protobuf:"bytes,18,opt,name=username,proto3" json:"username,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SearchRequest) Reset() { *m = SearchRequest{} } +func (m *SearchRequest) String() string { return proto.CompactTextString(m) } +func (*SearchRequest) ProtoMessage() {} +func (*SearchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{12} +} + +func (m *SearchRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SearchRequest.Unmarshal(m, b) +} +func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SearchRequest.Marshal(b, m, deterministic) +} +func (m *SearchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchRequest.Merge(m, src) +} +func (m *SearchRequest) XXX_Size() int { + return xxx_messageInfo_SearchRequest.Size(m) +} +func (m *SearchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SearchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchRequest proto.InternalMessageInfo + +func (m *SearchRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *SearchRequest) GetReqID() int64 { + if m != nil { + return m.ReqID + } + return 0 +} + +func (m *SearchRequest) GetDbID() int64 { + if m != nil { + return m.DbID + } + return 0 +} + +func (m *SearchRequest) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *SearchRequest) GetPartitionIDs() []int64 { + if m != nil { + return m.PartitionIDs + } + return nil +} + +func (m *SearchRequest) GetDsl() string { + if m != nil { + return m.Dsl + } + return "" +} + +func (m *SearchRequest) GetPlaceholderGroup() []byte { + if m != nil { + return m.PlaceholderGroup + } + return nil +} + +func (m *SearchRequest) GetDslType() commonpb.DslType { + if m != nil { + return m.DslType + } + return commonpb.DslType_Dsl +} + +func (m *SearchRequest) GetSerializedExprPlan() []byte { + if m != nil { + return m.SerializedExprPlan + } + return nil +} + +func (m *SearchRequest) GetOutputFieldsId() []int64 { + if m != nil { + return m.OutputFieldsId + } + return nil +} + +func (m *SearchRequest) GetTravelTimestamp() uint64 { + if m != nil { + return m.TravelTimestamp + } + return 0 +} + +func (m *SearchRequest) GetGuaranteeTimestamp() uint64 { + if m != nil { + return m.GuaranteeTimestamp + } + return 0 +} + +func (m *SearchRequest) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *SearchRequest) GetNq() int64 { + if m != nil { + return m.Nq + } + return 0 +} + +func (m *SearchRequest) GetTopk() int64 { + if m != nil { + return m.Topk + } + return 0 +} + +func (m *SearchRequest) GetMetricType() string { + if m != nil { + return m.MetricType + } + return "" +} + +func (m *SearchRequest) GetIgnoreGrowing() bool { + if m != nil { + return m.IgnoreGrowing + } + return false +} + +func (m *SearchRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +type SearchResults struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Status *commonpb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + ReqID int64 `protobuf:"varint,3,opt,name=reqID,proto3" json:"reqID,omitempty"` + MetricType string `protobuf:"bytes,4,opt,name=metric_type,json=metricType,proto3" json:"metric_type,omitempty"` + NumQueries int64 `protobuf:"varint,5,opt,name=num_queries,json=numQueries,proto3" json:"num_queries,omitempty"` + TopK int64 `protobuf:"varint,6,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"` + SealedSegmentIDsSearched []int64 `protobuf:"varint,7,rep,packed,name=sealed_segmentIDs_searched,json=sealedSegmentIDsSearched,proto3" json:"sealed_segmentIDs_searched,omitempty"` + ChannelIDsSearched []string `protobuf:"bytes,8,rep,name=channelIDs_searched,json=channelIDsSearched,proto3" json:"channelIDs_searched,omitempty"` + GlobalSealedSegmentIDs []int64 `protobuf:"varint,9,rep,packed,name=global_sealed_segmentIDs,json=globalSealedSegmentIDs,proto3" json:"global_sealed_segmentIDs,omitempty"` + // schema.SearchResultsData inside + SlicedBlob []byte `protobuf:"bytes,10,opt,name=sliced_blob,json=slicedBlob,proto3" json:"sliced_blob,omitempty"` + SlicedNumCount int64 `protobuf:"varint,11,opt,name=sliced_num_count,json=slicedNumCount,proto3" json:"sliced_num_count,omitempty"` + SlicedOffset int64 `protobuf:"varint,12,opt,name=sliced_offset,json=slicedOffset,proto3" json:"sliced_offset,omitempty"` + // search request cost + CostAggregation *CostAggregation `protobuf:"bytes,13,opt,name=costAggregation,proto3" json:"costAggregation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SearchResults) Reset() { *m = SearchResults{} } +func (m *SearchResults) String() string { return proto.CompactTextString(m) } +func (*SearchResults) ProtoMessage() {} +func (*SearchResults) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{13} +} + +func (m *SearchResults) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SearchResults.Unmarshal(m, b) +} +func (m *SearchResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SearchResults.Marshal(b, m, deterministic) +} +func (m *SearchResults) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchResults.Merge(m, src) +} +func (m *SearchResults) XXX_Size() int { + return xxx_messageInfo_SearchResults.Size(m) +} +func (m *SearchResults) XXX_DiscardUnknown() { + xxx_messageInfo_SearchResults.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchResults proto.InternalMessageInfo + +func (m *SearchResults) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *SearchResults) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *SearchResults) GetReqID() int64 { + if m != nil { + return m.ReqID + } + return 0 +} + +func (m *SearchResults) GetMetricType() string { + if m != nil { + return m.MetricType + } + return "" +} + +func (m *SearchResults) GetNumQueries() int64 { + if m != nil { + return m.NumQueries + } + return 0 +} + +func (m *SearchResults) GetTopK() int64 { + if m != nil { + return m.TopK + } + return 0 +} + +func (m *SearchResults) GetSealedSegmentIDsSearched() []int64 { + if m != nil { + return m.SealedSegmentIDsSearched + } + return nil +} + +func (m *SearchResults) GetChannelIDsSearched() []string { + if m != nil { + return m.ChannelIDsSearched + } + return nil +} + +func (m *SearchResults) GetGlobalSealedSegmentIDs() []int64 { + if m != nil { + return m.GlobalSealedSegmentIDs + } + return nil +} + +func (m *SearchResults) GetSlicedBlob() []byte { + if m != nil { + return m.SlicedBlob + } + return nil +} + +func (m *SearchResults) GetSlicedNumCount() int64 { + if m != nil { + return m.SlicedNumCount + } + return 0 +} + +func (m *SearchResults) GetSlicedOffset() int64 { + if m != nil { + return m.SlicedOffset + } + return 0 +} + +func (m *SearchResults) GetCostAggregation() *CostAggregation { + if m != nil { + return m.CostAggregation + } + return nil +} + +type CostAggregation struct { + ResponseTime int64 `protobuf:"varint,1,opt,name=responseTime,proto3" json:"responseTime,omitempty"` + ServiceTime int64 `protobuf:"varint,2,opt,name=serviceTime,proto3" json:"serviceTime,omitempty"` + TotalNQ int64 `protobuf:"varint,3,opt,name=totalNQ,proto3" json:"totalNQ,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CostAggregation) Reset() { *m = CostAggregation{} } +func (m *CostAggregation) String() string { return proto.CompactTextString(m) } +func (*CostAggregation) ProtoMessage() {} +func (*CostAggregation) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{14} +} + +func (m *CostAggregation) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CostAggregation.Unmarshal(m, b) +} +func (m *CostAggregation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CostAggregation.Marshal(b, m, deterministic) +} +func (m *CostAggregation) XXX_Merge(src proto.Message) { + xxx_messageInfo_CostAggregation.Merge(m, src) +} +func (m *CostAggregation) XXX_Size() int { + return xxx_messageInfo_CostAggregation.Size(m) +} +func (m *CostAggregation) XXX_DiscardUnknown() { + xxx_messageInfo_CostAggregation.DiscardUnknown(m) +} + +var xxx_messageInfo_CostAggregation proto.InternalMessageInfo + +func (m *CostAggregation) GetResponseTime() int64 { + if m != nil { + return m.ResponseTime + } + return 0 +} + +func (m *CostAggregation) GetServiceTime() int64 { + if m != nil { + return m.ServiceTime + } + return 0 +} + +func (m *CostAggregation) GetTotalNQ() int64 { + if m != nil { + return m.TotalNQ + } + return 0 +} + +type RetrieveRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + ReqID int64 `protobuf:"varint,2,opt,name=reqID,proto3" json:"reqID,omitempty"` + DbID int64 `protobuf:"varint,3,opt,name=dbID,proto3" json:"dbID,omitempty"` + CollectionID int64 `protobuf:"varint,4,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + PartitionIDs []int64 `protobuf:"varint,5,rep,packed,name=partitionIDs,proto3" json:"partitionIDs,omitempty"` + SerializedExprPlan []byte `protobuf:"bytes,6,opt,name=serialized_expr_plan,json=serializedExprPlan,proto3" json:"serialized_expr_plan,omitempty"` + OutputFieldsId []int64 `protobuf:"varint,7,rep,packed,name=output_fields_id,json=outputFieldsId,proto3" json:"output_fields_id,omitempty"` + TravelTimestamp uint64 `protobuf:"varint,8,opt,name=travel_timestamp,json=travelTimestamp,proto3" json:"travel_timestamp,omitempty"` + GuaranteeTimestamp uint64 `protobuf:"varint,9,opt,name=guarantee_timestamp,json=guaranteeTimestamp,proto3" json:"guarantee_timestamp,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,10,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + Limit int64 `protobuf:"varint,11,opt,name=limit,proto3" json:"limit,omitempty"` + IgnoreGrowing bool `protobuf:"varint,12,opt,name=ignoreGrowing,proto3" json:"ignoreGrowing,omitempty"` + IsCount bool `protobuf:"varint,13,opt,name=is_count,json=isCount,proto3" json:"is_count,omitempty"` + IterationExtensionReduceRate int64 `protobuf:"varint,14,opt,name=iteration_extension_reduce_rate,json=iterationExtensionReduceRate,proto3" json:"iteration_extension_reduce_rate,omitempty"` + Username string `protobuf:"bytes,15,opt,name=username,proto3" json:"username,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RetrieveRequest) Reset() { *m = RetrieveRequest{} } +func (m *RetrieveRequest) String() string { return proto.CompactTextString(m) } +func (*RetrieveRequest) ProtoMessage() {} +func (*RetrieveRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{15} +} + +func (m *RetrieveRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RetrieveRequest.Unmarshal(m, b) +} +func (m *RetrieveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RetrieveRequest.Marshal(b, m, deterministic) +} +func (m *RetrieveRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RetrieveRequest.Merge(m, src) +} +func (m *RetrieveRequest) XXX_Size() int { + return xxx_messageInfo_RetrieveRequest.Size(m) +} +func (m *RetrieveRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RetrieveRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RetrieveRequest proto.InternalMessageInfo + +func (m *RetrieveRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *RetrieveRequest) GetReqID() int64 { + if m != nil { + return m.ReqID + } + return 0 +} + +func (m *RetrieveRequest) GetDbID() int64 { + if m != nil { + return m.DbID + } + return 0 +} + +func (m *RetrieveRequest) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *RetrieveRequest) GetPartitionIDs() []int64 { + if m != nil { + return m.PartitionIDs + } + return nil +} + +func (m *RetrieveRequest) GetSerializedExprPlan() []byte { + if m != nil { + return m.SerializedExprPlan + } + return nil +} + +func (m *RetrieveRequest) GetOutputFieldsId() []int64 { + if m != nil { + return m.OutputFieldsId + } + return nil +} + +func (m *RetrieveRequest) GetTravelTimestamp() uint64 { + if m != nil { + return m.TravelTimestamp + } + return 0 +} + +func (m *RetrieveRequest) GetGuaranteeTimestamp() uint64 { + if m != nil { + return m.GuaranteeTimestamp + } + return 0 +} + +func (m *RetrieveRequest) GetTimeoutTimestamp() uint64 { + if m != nil { + return m.TimeoutTimestamp + } + return 0 +} + +func (m *RetrieveRequest) GetLimit() int64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *RetrieveRequest) GetIgnoreGrowing() bool { + if m != nil { + return m.IgnoreGrowing + } + return false +} + +func (m *RetrieveRequest) GetIsCount() bool { + if m != nil { + return m.IsCount + } + return false +} + +func (m *RetrieveRequest) GetIterationExtensionReduceRate() int64 { + if m != nil { + return m.IterationExtensionReduceRate + } + return 0 +} + +func (m *RetrieveRequest) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +type RetrieveResults struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Status *commonpb.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + ReqID int64 `protobuf:"varint,3,opt,name=reqID,proto3" json:"reqID,omitempty"` + Ids *schemapb.IDs `protobuf:"bytes,4,opt,name=ids,proto3" json:"ids,omitempty"` + FieldsData []*schemapb.FieldData `protobuf:"bytes,5,rep,name=fields_data,json=fieldsData,proto3" json:"fields_data,omitempty"` + SealedSegmentIDsRetrieved []int64 `protobuf:"varint,6,rep,packed,name=sealed_segmentIDs_retrieved,json=sealedSegmentIDsRetrieved,proto3" json:"sealed_segmentIDs_retrieved,omitempty"` + ChannelIDsRetrieved []string `protobuf:"bytes,7,rep,name=channelIDs_retrieved,json=channelIDsRetrieved,proto3" json:"channelIDs_retrieved,omitempty"` + GlobalSealedSegmentIDs []int64 `protobuf:"varint,8,rep,packed,name=global_sealed_segmentIDs,json=globalSealedSegmentIDs,proto3" json:"global_sealed_segmentIDs,omitempty"` + // query request cost + CostAggregation *CostAggregation `protobuf:"bytes,13,opt,name=costAggregation,proto3" json:"costAggregation,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RetrieveResults) Reset() { *m = RetrieveResults{} } +func (m *RetrieveResults) String() string { return proto.CompactTextString(m) } +func (*RetrieveResults) ProtoMessage() {} +func (*RetrieveResults) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{16} +} + +func (m *RetrieveResults) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RetrieveResults.Unmarshal(m, b) +} +func (m *RetrieveResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RetrieveResults.Marshal(b, m, deterministic) +} +func (m *RetrieveResults) XXX_Merge(src proto.Message) { + xxx_messageInfo_RetrieveResults.Merge(m, src) +} +func (m *RetrieveResults) XXX_Size() int { + return xxx_messageInfo_RetrieveResults.Size(m) +} +func (m *RetrieveResults) XXX_DiscardUnknown() { + xxx_messageInfo_RetrieveResults.DiscardUnknown(m) +} + +var xxx_messageInfo_RetrieveResults proto.InternalMessageInfo + +func (m *RetrieveResults) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *RetrieveResults) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *RetrieveResults) GetReqID() int64 { + if m != nil { + return m.ReqID + } + return 0 +} + +func (m *RetrieveResults) GetIds() *schemapb.IDs { + if m != nil { + return m.Ids + } + return nil +} + +func (m *RetrieveResults) GetFieldsData() []*schemapb.FieldData { + if m != nil { + return m.FieldsData + } + return nil +} + +func (m *RetrieveResults) GetSealedSegmentIDsRetrieved() []int64 { + if m != nil { + return m.SealedSegmentIDsRetrieved + } + return nil +} + +func (m *RetrieveResults) GetChannelIDsRetrieved() []string { + if m != nil { + return m.ChannelIDsRetrieved + } + return nil +} + +func (m *RetrieveResults) GetGlobalSealedSegmentIDs() []int64 { + if m != nil { + return m.GlobalSealedSegmentIDs + } + return nil +} + +func (m *RetrieveResults) GetCostAggregation() *CostAggregation { + if m != nil { + return m.CostAggregation + } + return nil +} + +type LoadIndex struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + SegmentID int64 `protobuf:"varint,2,opt,name=segmentID,proto3" json:"segmentID,omitempty"` + FieldName string `protobuf:"bytes,3,opt,name=fieldName,proto3" json:"fieldName,omitempty"` + FieldID int64 `protobuf:"varint,4,opt,name=fieldID,proto3" json:"fieldID,omitempty"` + IndexPaths []string `protobuf:"bytes,5,rep,name=index_paths,json=indexPaths,proto3" json:"index_paths,omitempty"` + IndexParams []*commonpb.KeyValuePair `protobuf:"bytes,6,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LoadIndex) Reset() { *m = LoadIndex{} } +func (m *LoadIndex) String() string { return proto.CompactTextString(m) } +func (*LoadIndex) ProtoMessage() {} +func (*LoadIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{17} +} + +func (m *LoadIndex) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LoadIndex.Unmarshal(m, b) +} +func (m *LoadIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LoadIndex.Marshal(b, m, deterministic) +} +func (m *LoadIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadIndex.Merge(m, src) +} +func (m *LoadIndex) XXX_Size() int { + return xxx_messageInfo_LoadIndex.Size(m) +} +func (m *LoadIndex) XXX_DiscardUnknown() { + xxx_messageInfo_LoadIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_LoadIndex proto.InternalMessageInfo + +func (m *LoadIndex) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *LoadIndex) GetSegmentID() int64 { + if m != nil { + return m.SegmentID + } + return 0 +} + +func (m *LoadIndex) GetFieldName() string { + if m != nil { + return m.FieldName + } + return "" +} + +func (m *LoadIndex) GetFieldID() int64 { + if m != nil { + return m.FieldID + } + return 0 +} + +func (m *LoadIndex) GetIndexPaths() []string { + if m != nil { + return m.IndexPaths + } + return nil +} + +func (m *LoadIndex) GetIndexParams() []*commonpb.KeyValuePair { + if m != nil { + return m.IndexParams + } + return nil +} + +type IndexStats struct { + IndexParams []*commonpb.KeyValuePair `protobuf:"bytes,1,rep,name=index_params,json=indexParams,proto3" json:"index_params,omitempty"` + NumRelatedSegments int64 `protobuf:"varint,2,opt,name=num_related_segments,json=numRelatedSegments,proto3" json:"num_related_segments,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IndexStats) Reset() { *m = IndexStats{} } +func (m *IndexStats) String() string { return proto.CompactTextString(m) } +func (*IndexStats) ProtoMessage() {} +func (*IndexStats) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{18} +} + +func (m *IndexStats) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_IndexStats.Unmarshal(m, b) +} +func (m *IndexStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_IndexStats.Marshal(b, m, deterministic) +} +func (m *IndexStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_IndexStats.Merge(m, src) +} +func (m *IndexStats) XXX_Size() int { + return xxx_messageInfo_IndexStats.Size(m) +} +func (m *IndexStats) XXX_DiscardUnknown() { + xxx_messageInfo_IndexStats.DiscardUnknown(m) +} + +var xxx_messageInfo_IndexStats proto.InternalMessageInfo + +func (m *IndexStats) GetIndexParams() []*commonpb.KeyValuePair { + if m != nil { + return m.IndexParams + } + return nil +} + +func (m *IndexStats) GetNumRelatedSegments() int64 { + if m != nil { + return m.NumRelatedSegments + } + return 0 +} + +type FieldStats struct { + CollectionID int64 `protobuf:"varint,1,opt,name=collectionID,proto3" json:"collectionID,omitempty"` + FieldID int64 `protobuf:"varint,2,opt,name=fieldID,proto3" json:"fieldID,omitempty"` + IndexStats []*IndexStats `protobuf:"bytes,3,rep,name=index_stats,json=indexStats,proto3" json:"index_stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FieldStats) Reset() { *m = FieldStats{} } +func (m *FieldStats) String() string { return proto.CompactTextString(m) } +func (*FieldStats) ProtoMessage() {} +func (*FieldStats) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{19} +} + +func (m *FieldStats) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FieldStats.Unmarshal(m, b) +} +func (m *FieldStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FieldStats.Marshal(b, m, deterministic) +} +func (m *FieldStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldStats.Merge(m, src) +} +func (m *FieldStats) XXX_Size() int { + return xxx_messageInfo_FieldStats.Size(m) +} +func (m *FieldStats) XXX_DiscardUnknown() { + xxx_messageInfo_FieldStats.DiscardUnknown(m) +} + +var xxx_messageInfo_FieldStats proto.InternalMessageInfo + +func (m *FieldStats) GetCollectionID() int64 { + if m != nil { + return m.CollectionID + } + return 0 +} + +func (m *FieldStats) GetFieldID() int64 { + if m != nil { + return m.FieldID + } + return 0 +} + +func (m *FieldStats) GetIndexStats() []*IndexStats { + if m != nil { + return m.IndexStats + } + return nil +} + +type SegmentStats struct { + SegmentID int64 `protobuf:"varint,1,opt,name=segmentID,proto3" json:"segmentID,omitempty"` + MemorySize int64 `protobuf:"varint,2,opt,name=memory_size,json=memorySize,proto3" json:"memory_size,omitempty"` + NumRows int64 `protobuf:"varint,3,opt,name=num_rows,json=numRows,proto3" json:"num_rows,omitempty"` + RecentlyModified bool `protobuf:"varint,4,opt,name=recently_modified,json=recentlyModified,proto3" json:"recently_modified,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SegmentStats) Reset() { *m = SegmentStats{} } +func (m *SegmentStats) String() string { return proto.CompactTextString(m) } +func (*SegmentStats) ProtoMessage() {} +func (*SegmentStats) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{20} +} + +func (m *SegmentStats) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SegmentStats.Unmarshal(m, b) +} +func (m *SegmentStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SegmentStats.Marshal(b, m, deterministic) +} +func (m *SegmentStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_SegmentStats.Merge(m, src) +} +func (m *SegmentStats) XXX_Size() int { + return xxx_messageInfo_SegmentStats.Size(m) +} +func (m *SegmentStats) XXX_DiscardUnknown() { + xxx_messageInfo_SegmentStats.DiscardUnknown(m) +} + +var xxx_messageInfo_SegmentStats proto.InternalMessageInfo + +func (m *SegmentStats) GetSegmentID() int64 { + if m != nil { + return m.SegmentID + } + return 0 +} + +func (m *SegmentStats) GetMemorySize() int64 { + if m != nil { + return m.MemorySize + } + return 0 +} + +func (m *SegmentStats) GetNumRows() int64 { + if m != nil { + return m.NumRows + } + return 0 +} + +func (m *SegmentStats) GetRecentlyModified() bool { + if m != nil { + return m.RecentlyModified + } + return false +} + +type ChannelTimeTickMsg struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + ChannelNames []string `protobuf:"bytes,2,rep,name=channelNames,proto3" json:"channelNames,omitempty"` + Timestamps []uint64 `protobuf:"varint,3,rep,packed,name=timestamps,proto3" json:"timestamps,omitempty"` + DefaultTimestamp uint64 `protobuf:"varint,4,opt,name=default_timestamp,json=defaultTimestamp,proto3" json:"default_timestamp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelTimeTickMsg) Reset() { *m = ChannelTimeTickMsg{} } +func (m *ChannelTimeTickMsg) String() string { return proto.CompactTextString(m) } +func (*ChannelTimeTickMsg) ProtoMessage() {} +func (*ChannelTimeTickMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{21} +} + +func (m *ChannelTimeTickMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelTimeTickMsg.Unmarshal(m, b) +} +func (m *ChannelTimeTickMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelTimeTickMsg.Marshal(b, m, deterministic) +} +func (m *ChannelTimeTickMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelTimeTickMsg.Merge(m, src) +} +func (m *ChannelTimeTickMsg) XXX_Size() int { + return xxx_messageInfo_ChannelTimeTickMsg.Size(m) +} +func (m *ChannelTimeTickMsg) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelTimeTickMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelTimeTickMsg proto.InternalMessageInfo + +func (m *ChannelTimeTickMsg) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *ChannelTimeTickMsg) GetChannelNames() []string { + if m != nil { + return m.ChannelNames + } + return nil +} + +func (m *ChannelTimeTickMsg) GetTimestamps() []uint64 { + if m != nil { + return m.Timestamps + } + return nil +} + +func (m *ChannelTimeTickMsg) GetDefaultTimestamp() uint64 { + if m != nil { + return m.DefaultTimestamp + } + return 0 +} + +type CredentialInfo struct { + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // encrypted by bcrypt (for higher security level) + EncryptedPassword string `protobuf:"bytes,2,opt,name=encrypted_password,json=encryptedPassword,proto3" json:"encrypted_password,omitempty"` + Tenant string `protobuf:"bytes,3,opt,name=tenant,proto3" json:"tenant,omitempty"` + IsSuper bool `protobuf:"varint,4,opt,name=is_super,json=isSuper,proto3" json:"is_super,omitempty"` + // encrypted by sha256 (for good performance in cache mapping) + Sha256Password string `protobuf:"bytes,5,opt,name=sha256_password,json=sha256Password,proto3" json:"sha256_password,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CredentialInfo) Reset() { *m = CredentialInfo{} } +func (m *CredentialInfo) String() string { return proto.CompactTextString(m) } +func (*CredentialInfo) ProtoMessage() {} +func (*CredentialInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{22} +} + +func (m *CredentialInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CredentialInfo.Unmarshal(m, b) +} +func (m *CredentialInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CredentialInfo.Marshal(b, m, deterministic) +} +func (m *CredentialInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_CredentialInfo.Merge(m, src) +} +func (m *CredentialInfo) XXX_Size() int { + return xxx_messageInfo_CredentialInfo.Size(m) +} +func (m *CredentialInfo) XXX_DiscardUnknown() { + xxx_messageInfo_CredentialInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_CredentialInfo proto.InternalMessageInfo + +func (m *CredentialInfo) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *CredentialInfo) GetEncryptedPassword() string { + if m != nil { + return m.EncryptedPassword + } + return "" +} + +func (m *CredentialInfo) GetTenant() string { + if m != nil { + return m.Tenant + } + return "" +} + +func (m *CredentialInfo) GetIsSuper() bool { + if m != nil { + return m.IsSuper + } + return false +} + +func (m *CredentialInfo) GetSha256Password() string { + if m != nil { + return m.Sha256Password + } + return "" +} + +type ListPolicyRequest struct { + // Not useful for now + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListPolicyRequest) Reset() { *m = ListPolicyRequest{} } +func (m *ListPolicyRequest) String() string { return proto.CompactTextString(m) } +func (*ListPolicyRequest) ProtoMessage() {} +func (*ListPolicyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{23} +} + +func (m *ListPolicyRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListPolicyRequest.Unmarshal(m, b) +} +func (m *ListPolicyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListPolicyRequest.Marshal(b, m, deterministic) +} +func (m *ListPolicyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPolicyRequest.Merge(m, src) +} +func (m *ListPolicyRequest) XXX_Size() int { + return xxx_messageInfo_ListPolicyRequest.Size(m) +} +func (m *ListPolicyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListPolicyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPolicyRequest proto.InternalMessageInfo + +func (m *ListPolicyRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +type ListPolicyResponse struct { + // Contain error_code and reason + Status *commonpb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + PolicyInfos []string `protobuf:"bytes,2,rep,name=policy_infos,json=policyInfos,proto3" json:"policy_infos,omitempty"` + UserRoles []string `protobuf:"bytes,3,rep,name=user_roles,json=userRoles,proto3" json:"user_roles,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListPolicyResponse) Reset() { *m = ListPolicyResponse{} } +func (m *ListPolicyResponse) String() string { return proto.CompactTextString(m) } +func (*ListPolicyResponse) ProtoMessage() {} +func (*ListPolicyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{24} +} + +func (m *ListPolicyResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListPolicyResponse.Unmarshal(m, b) +} +func (m *ListPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListPolicyResponse.Marshal(b, m, deterministic) +} +func (m *ListPolicyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPolicyResponse.Merge(m, src) +} +func (m *ListPolicyResponse) XXX_Size() int { + return xxx_messageInfo_ListPolicyResponse.Size(m) +} +func (m *ListPolicyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListPolicyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPolicyResponse proto.InternalMessageInfo + +func (m *ListPolicyResponse) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *ListPolicyResponse) GetPolicyInfos() []string { + if m != nil { + return m.PolicyInfos + } + return nil +} + +func (m *ListPolicyResponse) GetUserRoles() []string { + if m != nil { + return m.UserRoles + } + return nil +} + +type ShowConfigurationsRequest struct { + Base *commonpb.MsgBase `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Pattern string `protobuf:"bytes,2,opt,name=pattern,proto3" json:"pattern,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ShowConfigurationsRequest) Reset() { *m = ShowConfigurationsRequest{} } +func (m *ShowConfigurationsRequest) String() string { return proto.CompactTextString(m) } +func (*ShowConfigurationsRequest) ProtoMessage() {} +func (*ShowConfigurationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{25} +} + +func (m *ShowConfigurationsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ShowConfigurationsRequest.Unmarshal(m, b) +} +func (m *ShowConfigurationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ShowConfigurationsRequest.Marshal(b, m, deterministic) +} +func (m *ShowConfigurationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ShowConfigurationsRequest.Merge(m, src) +} +func (m *ShowConfigurationsRequest) XXX_Size() int { + return xxx_messageInfo_ShowConfigurationsRequest.Size(m) +} +func (m *ShowConfigurationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ShowConfigurationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ShowConfigurationsRequest proto.InternalMessageInfo + +func (m *ShowConfigurationsRequest) GetBase() *commonpb.MsgBase { + if m != nil { + return m.Base + } + return nil +} + +func (m *ShowConfigurationsRequest) GetPattern() string { + if m != nil { + return m.Pattern + } + return "" +} + +type ShowConfigurationsResponse struct { + Status *commonpb.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` + Configuations []*commonpb.KeyValuePair `protobuf:"bytes,2,rep,name=configuations,proto3" json:"configuations,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ShowConfigurationsResponse) Reset() { *m = ShowConfigurationsResponse{} } +func (m *ShowConfigurationsResponse) String() string { return proto.CompactTextString(m) } +func (*ShowConfigurationsResponse) ProtoMessage() {} +func (*ShowConfigurationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{26} +} + +func (m *ShowConfigurationsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ShowConfigurationsResponse.Unmarshal(m, b) +} +func (m *ShowConfigurationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ShowConfigurationsResponse.Marshal(b, m, deterministic) +} +func (m *ShowConfigurationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ShowConfigurationsResponse.Merge(m, src) +} +func (m *ShowConfigurationsResponse) XXX_Size() int { + return xxx_messageInfo_ShowConfigurationsResponse.Size(m) +} +func (m *ShowConfigurationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ShowConfigurationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ShowConfigurationsResponse proto.InternalMessageInfo + +func (m *ShowConfigurationsResponse) GetStatus() *commonpb.Status { + if m != nil { + return m.Status + } + return nil +} + +func (m *ShowConfigurationsResponse) GetConfiguations() []*commonpb.KeyValuePair { + if m != nil { + return m.Configuations + } + return nil +} + +type Rate struct { + Rt RateType `protobuf:"varint,1,opt,name=rt,proto3,enum=milvus.proto.internal.RateType" json:"rt,omitempty"` + R float64 `protobuf:"fixed64,2,opt,name=r,proto3" json:"r,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Rate) Reset() { *m = Rate{} } +func (m *Rate) String() string { return proto.CompactTextString(m) } +func (*Rate) ProtoMessage() {} +func (*Rate) Descriptor() ([]byte, []int) { + return fileDescriptor_41f4a519b878ee3b, []int{27} +} + +func (m *Rate) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Rate.Unmarshal(m, b) +} +func (m *Rate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Rate.Marshal(b, m, deterministic) +} +func (m *Rate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rate.Merge(m, src) +} +func (m *Rate) XXX_Size() int { + return xxx_messageInfo_Rate.Size(m) +} +func (m *Rate) XXX_DiscardUnknown() { + xxx_messageInfo_Rate.DiscardUnknown(m) +} + +var xxx_messageInfo_Rate proto.InternalMessageInfo + +func (m *Rate) GetRt() RateType { + if m != nil { + return m.Rt + } + return RateType_DDLCollection +} + +func (m *Rate) GetR() float64 { + if m != nil { + return m.R + } + return 0 +} + +func init() { + proto.RegisterEnum("milvus.proto.internal.RateType", RateType_name, RateType_value) + proto.RegisterType((*GetTimeTickChannelRequest)(nil), "milvus.proto.internal.GetTimeTickChannelRequest") + proto.RegisterType((*GetStatisticsChannelRequest)(nil), "milvus.proto.internal.GetStatisticsChannelRequest") + proto.RegisterType((*GetDdChannelRequest)(nil), "milvus.proto.internal.GetDdChannelRequest") + proto.RegisterType((*NodeInfo)(nil), "milvus.proto.internal.NodeInfo") + proto.RegisterType((*InitParams)(nil), "milvus.proto.internal.InitParams") + proto.RegisterType((*StringList)(nil), "milvus.proto.internal.StringList") + proto.RegisterType((*GetStatisticsRequest)(nil), "milvus.proto.internal.GetStatisticsRequest") + proto.RegisterType((*GetStatisticsResponse)(nil), "milvus.proto.internal.GetStatisticsResponse") + proto.RegisterType((*CreateAliasRequest)(nil), "milvus.proto.internal.CreateAliasRequest") + proto.RegisterType((*DropAliasRequest)(nil), "milvus.proto.internal.DropAliasRequest") + proto.RegisterType((*AlterAliasRequest)(nil), "milvus.proto.internal.AlterAliasRequest") + proto.RegisterType((*CreateIndexRequest)(nil), "milvus.proto.internal.CreateIndexRequest") + proto.RegisterType((*SearchRequest)(nil), "milvus.proto.internal.SearchRequest") + proto.RegisterType((*SearchResults)(nil), "milvus.proto.internal.SearchResults") + proto.RegisterType((*CostAggregation)(nil), "milvus.proto.internal.CostAggregation") + proto.RegisterType((*RetrieveRequest)(nil), "milvus.proto.internal.RetrieveRequest") + proto.RegisterType((*RetrieveResults)(nil), "milvus.proto.internal.RetrieveResults") + proto.RegisterType((*LoadIndex)(nil), "milvus.proto.internal.LoadIndex") + proto.RegisterType((*IndexStats)(nil), "milvus.proto.internal.IndexStats") + proto.RegisterType((*FieldStats)(nil), "milvus.proto.internal.FieldStats") + proto.RegisterType((*SegmentStats)(nil), "milvus.proto.internal.SegmentStats") + proto.RegisterType((*ChannelTimeTickMsg)(nil), "milvus.proto.internal.ChannelTimeTickMsg") + proto.RegisterType((*CredentialInfo)(nil), "milvus.proto.internal.CredentialInfo") + proto.RegisterType((*ListPolicyRequest)(nil), "milvus.proto.internal.ListPolicyRequest") + proto.RegisterType((*ListPolicyResponse)(nil), "milvus.proto.internal.ListPolicyResponse") + proto.RegisterType((*ShowConfigurationsRequest)(nil), "milvus.proto.internal.ShowConfigurationsRequest") + proto.RegisterType((*ShowConfigurationsResponse)(nil), "milvus.proto.internal.ShowConfigurationsResponse") + proto.RegisterType((*Rate)(nil), "milvus.proto.internal.Rate") +} + +func init() { proto.RegisterFile("internal.proto", fileDescriptor_41f4a519b878ee3b) } + +var fileDescriptor_41f4a519b878ee3b = []byte{ + // 1927 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x4b, 0x73, 0x1c, 0x49, + 0x11, 0xa6, 0xe7, 0x3d, 0x39, 0x23, 0x69, 0x54, 0x96, 0x4d, 0xfb, 0xb1, 0x6b, 0x6d, 0x43, 0x80, + 0x58, 0x62, 0xed, 0x45, 0x1b, 0xbb, 0xe6, 0x40, 0x40, 0xd8, 0x6a, 0xaf, 0x62, 0x62, 0xc7, 0x46, + 0xee, 0x31, 0x1b, 0x01, 0x97, 0x8e, 0x9a, 0xe9, 0xd4, 0xa8, 0x70, 0xbf, 0x54, 0x55, 0x6d, 0x49, + 0x3e, 0x73, 0x23, 0x82, 0x1b, 0x1c, 0x88, 0x80, 0x7f, 0xc0, 0x79, 0x83, 0x13, 0xff, 0x80, 0x13, + 0xbf, 0x66, 0x4f, 0x44, 0x3d, 0x7a, 0x5e, 0x1a, 0x2b, 0x24, 0x99, 0xc7, 0xee, 0xad, 0x33, 0xf3, + 0xab, 0xac, 0xaa, 0xcc, 0xac, 0xaf, 0xb2, 0x1a, 0xd6, 0x59, 0x2a, 0x91, 0xa7, 0x34, 0x7e, 0x90, + 0xf3, 0x4c, 0x66, 0xe4, 0x66, 0xc2, 0xe2, 0xd7, 0x85, 0x30, 0xd2, 0x83, 0xd2, 0x78, 0xa7, 0x3b, + 0xce, 0x92, 0x24, 0x4b, 0x8d, 0xfa, 0x4e, 0x57, 0x8c, 0x8f, 0x30, 0xa1, 0x46, 0xf2, 0xee, 0xc2, + 0xed, 0x7d, 0x94, 0x2f, 0x59, 0x82, 0x2f, 0xd9, 0xf8, 0xd5, 0xde, 0x11, 0x4d, 0x53, 0x8c, 0x03, + 0x3c, 0x2e, 0x50, 0x48, 0xef, 0x3d, 0xb8, 0xbb, 0x8f, 0x72, 0x28, 0xa9, 0x64, 0x42, 0xb2, 0xb1, + 0x58, 0x32, 0xdf, 0x84, 0x1b, 0xfb, 0x28, 0xfd, 0x68, 0x49, 0xfd, 0x25, 0xb4, 0x9e, 0x67, 0x11, + 0xf6, 0xd3, 0xc3, 0x8c, 0x7c, 0x06, 0x4d, 0x1a, 0x45, 0x1c, 0x85, 0x70, 0x9d, 0x6d, 0x67, 0xa7, + 0xb3, 0x7b, 0xef, 0xc1, 0xc2, 0x1a, 0xed, 0xca, 0x1e, 0x1b, 0x4c, 0x50, 0x82, 0x09, 0x81, 0x1a, + 0xcf, 0x62, 0x74, 0x2b, 0xdb, 0xce, 0x4e, 0x3b, 0xd0, 0xdf, 0xde, 0x6f, 0x01, 0xfa, 0x29, 0x93, + 0x07, 0x94, 0xd3, 0x44, 0x90, 0x5b, 0xd0, 0x48, 0xd5, 0x2c, 0xbe, 0x76, 0x5c, 0x0d, 0xac, 0x44, + 0x7c, 0xe8, 0x0a, 0x49, 0xb9, 0x0c, 0x73, 0x8d, 0x73, 0x2b, 0xdb, 0xd5, 0x9d, 0xce, 0xee, 0x07, + 0x2b, 0xa7, 0xfd, 0x02, 0xcf, 0xbe, 0xa4, 0x71, 0x81, 0x07, 0x94, 0xf1, 0xa0, 0xa3, 0x87, 0x19, + 0xef, 0xde, 0xaf, 0x01, 0x86, 0x92, 0xb3, 0x74, 0x32, 0x60, 0x42, 0xaa, 0xb9, 0x5e, 0x2b, 0x9c, + 0xda, 0x44, 0x75, 0xa7, 0x1d, 0x58, 0x89, 0x7c, 0x02, 0x0d, 0x21, 0xa9, 0x2c, 0x84, 0x5e, 0x67, + 0x67, 0xf7, 0xee, 0xca, 0x59, 0x86, 0x1a, 0x12, 0x58, 0xa8, 0xf7, 0xb7, 0x0a, 0x6c, 0x2d, 0x44, + 0xd5, 0xc6, 0x8d, 0x7c, 0x0c, 0xb5, 0x11, 0x15, 0x78, 0x61, 0xa0, 0x9e, 0x89, 0xc9, 0x13, 0x2a, + 0x30, 0xd0, 0x48, 0x15, 0xa5, 0x68, 0xd4, 0xf7, 0xf5, 0xec, 0xd5, 0x40, 0x7f, 0x13, 0x0f, 0xba, + 0xe3, 0x2c, 0x8e, 0x71, 0x2c, 0x59, 0x96, 0xf6, 0x7d, 0xb7, 0xaa, 0x6d, 0x0b, 0x3a, 0x85, 0xc9, + 0x29, 0x97, 0xcc, 0x88, 0xc2, 0xad, 0x6d, 0x57, 0x15, 0x66, 0x5e, 0x47, 0x7e, 0x04, 0x3d, 0xc9, + 0xe9, 0x6b, 0x8c, 0x43, 0xc9, 0x12, 0x14, 0x92, 0x26, 0xb9, 0x5b, 0xdf, 0x76, 0x76, 0x6a, 0xc1, + 0x86, 0xd1, 0xbf, 0x2c, 0xd5, 0xe4, 0x21, 0xdc, 0x98, 0x14, 0x94, 0xd3, 0x54, 0x22, 0xce, 0xa1, + 0x1b, 0x1a, 0x4d, 0xa6, 0xa6, 0xd9, 0x80, 0x1f, 0xc3, 0xa6, 0x82, 0x65, 0x85, 0x9c, 0x83, 0x37, + 0x35, 0xbc, 0x67, 0x0d, 0x53, 0xb0, 0xf7, 0x95, 0x03, 0x37, 0x97, 0xe2, 0x25, 0xf2, 0x2c, 0x15, + 0x78, 0x8d, 0x80, 0x5d, 0x27, 0x61, 0xe4, 0x11, 0xd4, 0xd5, 0x97, 0x70, 0xab, 0x97, 0x2d, 0x25, + 0x83, 0xf7, 0xfe, 0xea, 0x00, 0xd9, 0xe3, 0x48, 0x25, 0x3e, 0x8e, 0x19, 0x7d, 0x87, 0x3c, 0x7f, + 0x17, 0x9a, 0xd1, 0x28, 0x4c, 0x69, 0x52, 0x1e, 0x88, 0x46, 0x34, 0x7a, 0x4e, 0x13, 0x24, 0x3f, + 0x84, 0x8d, 0x59, 0x62, 0x0d, 0xa0, 0xaa, 0x01, 0xeb, 0x33, 0xb5, 0x06, 0x6e, 0x41, 0x9d, 0xaa, + 0x35, 0xb8, 0x35, 0x6d, 0x36, 0x82, 0x27, 0xa0, 0xe7, 0xf3, 0x2c, 0xff, 0x6f, 0xad, 0x6e, 0x3a, + 0x69, 0x75, 0x7e, 0xd2, 0xbf, 0x38, 0xb0, 0xf9, 0x38, 0x96, 0xc8, 0xbf, 0xa1, 0x41, 0xf9, 0x47, + 0xa5, 0xcc, 0x5a, 0x3f, 0x8d, 0xf0, 0xf4, 0xff, 0xb9, 0xc0, 0xf7, 0x00, 0x0e, 0x19, 0xc6, 0x91, + 0xc1, 0x98, 0x55, 0xb6, 0xb5, 0x46, 0x9b, 0xcb, 0xe3, 0x5f, 0xbf, 0xe0, 0xf8, 0x37, 0x56, 0x1c, + 0x7f, 0x17, 0x9a, 0xda, 0x49, 0xdf, 0xd7, 0x87, 0xae, 0x1a, 0x94, 0xa2, 0x22, 0x4f, 0x3c, 0x95, + 0x9c, 0x96, 0xe4, 0xd9, 0xba, 0x34, 0x79, 0xea, 0x61, 0x96, 0x3c, 0xff, 0x54, 0x87, 0xb5, 0x21, + 0x52, 0x3e, 0x3e, 0xba, 0x7e, 0xf0, 0xb6, 0xa0, 0xce, 0xf1, 0x78, 0xca, 0x6d, 0x46, 0x98, 0xee, + 0xb8, 0x7a, 0xc1, 0x8e, 0x6b, 0x97, 0x20, 0xbc, 0xfa, 0x0a, 0xc2, 0xeb, 0x41, 0x35, 0x12, 0xb1, + 0x0e, 0x58, 0x3b, 0x50, 0x9f, 0x8a, 0xa6, 0xf2, 0x98, 0x8e, 0xf1, 0x28, 0x8b, 0x23, 0xe4, 0xe1, + 0x84, 0x67, 0x85, 0xa1, 0xa9, 0x6e, 0xd0, 0x9b, 0x33, 0xec, 0x2b, 0x3d, 0x79, 0x04, 0xad, 0x48, + 0xc4, 0xa1, 0x3c, 0xcb, 0xd1, 0x6d, 0x6d, 0x3b, 0x3b, 0xeb, 0x6f, 0xd9, 0xa6, 0x2f, 0xe2, 0x97, + 0x67, 0x39, 0x06, 0xcd, 0xc8, 0x7c, 0x90, 0x8f, 0x61, 0x4b, 0x20, 0x67, 0x34, 0x66, 0x6f, 0x30, + 0x0a, 0xf1, 0x34, 0xe7, 0x61, 0x1e, 0xd3, 0xd4, 0x6d, 0xeb, 0x89, 0xc8, 0xcc, 0xf6, 0xf4, 0x34, + 0xe7, 0x07, 0x31, 0x4d, 0xc9, 0x0e, 0xf4, 0xb2, 0x42, 0xe6, 0x85, 0x0c, 0x75, 0xde, 0x44, 0xc8, + 0x22, 0x17, 0xf4, 0x8e, 0xd6, 0x8d, 0xfe, 0x73, 0xad, 0xee, 0x47, 0x2b, 0x49, 0xbc, 0x73, 0x25, + 0x12, 0xef, 0x5e, 0x8d, 0xc4, 0xd7, 0x56, 0x93, 0x38, 0x59, 0x87, 0x4a, 0x7a, 0xec, 0xae, 0xeb, + 0xd4, 0x54, 0xd2, 0x63, 0x95, 0x48, 0x99, 0xe5, 0xaf, 0xdc, 0x0d, 0x93, 0x48, 0xf5, 0x4d, 0xde, + 0x07, 0x48, 0x50, 0x72, 0x36, 0x56, 0x61, 0x71, 0x7b, 0x3a, 0x0f, 0x73, 0x1a, 0xf2, 0x7d, 0x58, + 0x63, 0x93, 0x34, 0xe3, 0xb8, 0xcf, 0xb3, 0x13, 0x96, 0x4e, 0xdc, 0xcd, 0x6d, 0x67, 0xa7, 0x15, + 0x2c, 0x2a, 0xc9, 0x1d, 0x68, 0x15, 0x42, 0xf5, 0x3d, 0x09, 0xba, 0x44, 0xfb, 0x98, 0xca, 0xde, + 0x3f, 0x6b, 0xb3, 0xc2, 0x14, 0x45, 0x2c, 0xc5, 0xff, 0xea, 0x0a, 0x99, 0x56, 0x73, 0x75, 0xbe, + 0x9a, 0xef, 0x43, 0xc7, 0x6c, 0xcf, 0x54, 0x4d, 0xed, 0xdc, 0x8e, 0xef, 0x43, 0x27, 0x2d, 0x92, + 0xf0, 0xb8, 0x40, 0xce, 0x50, 0xd8, 0x73, 0x0e, 0x69, 0x91, 0xbc, 0x30, 0x1a, 0x72, 0x03, 0xea, + 0x32, 0xcb, 0xc3, 0x57, 0xf6, 0x98, 0xab, 0x38, 0x7e, 0x41, 0x7e, 0x06, 0x77, 0x04, 0xd2, 0x18, + 0xa3, 0x50, 0xe0, 0x24, 0xc1, 0x54, 0xf6, 0x7d, 0x11, 0x0a, 0xbd, 0x6d, 0x8c, 0xdc, 0xa6, 0x2e, + 0x14, 0xd7, 0x20, 0x86, 0x53, 0xc0, 0xd0, 0xda, 0x55, 0x1d, 0x8c, 0x4d, 0x3f, 0xb7, 0x30, 0xac, + 0xa5, 0x1b, 0x1f, 0x32, 0x33, 0x4d, 0x07, 0xfc, 0x14, 0xdc, 0x49, 0x9c, 0x8d, 0x68, 0x1c, 0x9e, + 0x9b, 0xd5, 0x6d, 0xeb, 0xc9, 0x6e, 0x19, 0xfb, 0x70, 0x69, 0x4a, 0xb5, 0x3d, 0x11, 0xb3, 0x31, + 0x46, 0xe1, 0x28, 0xce, 0x46, 0x2e, 0xe8, 0x82, 0x07, 0xa3, 0x7a, 0x12, 0x67, 0x23, 0x55, 0xe8, + 0x16, 0xa0, 0xc2, 0x30, 0xce, 0x8a, 0x54, 0xea, 0xf2, 0xad, 0x06, 0xeb, 0x46, 0xff, 0xbc, 0x48, + 0xf6, 0x94, 0x96, 0x7c, 0x0f, 0xd6, 0x2c, 0x32, 0x3b, 0x3c, 0x14, 0x28, 0x75, 0xdd, 0x56, 0x83, + 0xae, 0x51, 0xfe, 0x52, 0xeb, 0xc8, 0x81, 0xe2, 0x5d, 0x21, 0x1f, 0x4f, 0x26, 0x1c, 0x27, 0x54, + 0x9d, 0x7b, 0x5d, 0xaf, 0x9d, 0xdd, 0x1f, 0x3c, 0x58, 0xd9, 0x38, 0x3f, 0xd8, 0x5b, 0x44, 0x07, + 0xcb, 0xc3, 0xbd, 0x63, 0xd8, 0x58, 0xc2, 0x28, 0xaa, 0xe1, 0xb6, 0x41, 0x51, 0xe5, 0x6f, 0xbb, + 0xd3, 0x05, 0x1d, 0xd9, 0x86, 0x8e, 0x40, 0xfe, 0x9a, 0x8d, 0x0d, 0xc4, 0x50, 0xdc, 0xbc, 0x4a, + 0x51, 0xb4, 0xcc, 0x24, 0x8d, 0x9f, 0xbf, 0xb0, 0x25, 0x53, 0x8a, 0xde, 0xbf, 0x6a, 0xb0, 0x11, + 0xa8, 0x12, 0xc1, 0xd7, 0xf8, 0x6d, 0xa2, 0xd7, 0xb7, 0xd1, 0x5c, 0xe3, 0x4a, 0x34, 0xd7, 0xbc, + 0x34, 0xcd, 0xb5, 0xae, 0x44, 0x73, 0xed, 0xab, 0xd1, 0x1c, 0xbc, 0x85, 0xe6, 0xb6, 0xa0, 0x1e, + 0xb3, 0x84, 0x95, 0x55, 0x6a, 0x84, 0xf3, 0xc4, 0xd5, 0x5d, 0x45, 0x5c, 0xb7, 0xa1, 0xc5, 0x84, + 0x2d, 0xf2, 0x35, 0x0d, 0x68, 0x32, 0x61, 0xaa, 0xfb, 0x29, 0xdc, 0x67, 0x12, 0xb9, 0x2e, 0xb0, + 0x10, 0x4f, 0x25, 0xa6, 0x42, 0x7d, 0x71, 0x8c, 0x8a, 0x31, 0x86, 0x9c, 0x4a, 0xb4, 0xd4, 0x7a, + 0x6f, 0x0a, 0x7b, 0x5a, 0xa2, 0x02, 0x0d, 0x0a, 0xa8, 0xc4, 0x05, 0x6a, 0xdc, 0x58, 0xa2, 0xc6, + 0xaf, 0xab, 0xf3, 0x65, 0xf5, 0x0d, 0x20, 0xc7, 0x0f, 0xa1, 0xca, 0x22, 0xd3, 0x9a, 0x75, 0x76, + 0xdd, 0x45, 0x3f, 0xf6, 0x05, 0xdb, 0xf7, 0x45, 0xa0, 0x40, 0xe4, 0x17, 0xd0, 0xb1, 0x25, 0x12, + 0x51, 0x49, 0x75, 0xf9, 0x75, 0x76, 0xdf, 0x5f, 0x39, 0x46, 0xd7, 0x8c, 0x4f, 0x25, 0x0d, 0x4c, + 0x6b, 0x25, 0xd4, 0x37, 0xf9, 0x39, 0xdc, 0x3d, 0x4f, 0x99, 0xdc, 0x86, 0x23, 0x72, 0x1b, 0xba, + 0xea, 0x6e, 0x2f, 0x73, 0x66, 0x19, 0xaf, 0x88, 0xfc, 0x04, 0xb6, 0xe6, 0x48, 0x73, 0x36, 0xb0, + 0xa9, 0x59, 0x73, 0x8e, 0x50, 0x67, 0x43, 0x2e, 0xa2, 0xcd, 0xd6, 0x85, 0xb4, 0xf9, 0x9f, 0xa7, + 0xb1, 0xaf, 0x1d, 0x68, 0x0f, 0x32, 0x1a, 0xe9, 0x86, 0xf7, 0x1a, 0x69, 0xbf, 0x07, 0xed, 0xe9, + 0xea, 0x2d, 0xa3, 0xcc, 0x14, 0xca, 0x3a, 0xed, 0x59, 0x6d, 0xa3, 0x3b, 0xd7, 0xc4, 0xce, 0x35, + 0xa3, 0xb5, 0xc5, 0x66, 0xf4, 0x3e, 0x74, 0x98, 0x5a, 0x50, 0x98, 0x53, 0x79, 0x64, 0x48, 0xa5, + 0x1d, 0x80, 0x56, 0x1d, 0x28, 0x8d, 0xea, 0x56, 0x4b, 0x80, 0xee, 0x56, 0x1b, 0x97, 0xee, 0x56, + 0xad, 0x13, 0xdd, 0xad, 0xfe, 0xce, 0x01, 0xd0, 0x1b, 0x57, 0x65, 0x79, 0xde, 0xa9, 0x73, 0x1d, + 0xa7, 0x8a, 0xed, 0xd4, 0x95, 0xc5, 0x31, 0xa6, 0x72, 0x96, 0x5b, 0x61, 0x83, 0x43, 0xd2, 0x22, + 0x09, 0x8c, 0xc9, 0xe6, 0x55, 0x78, 0x7f, 0x70, 0x00, 0x74, 0x71, 0x9a, 0x65, 0x2c, 0xd3, 0xae, + 0x73, 0x71, 0x1f, 0x5f, 0x59, 0x0c, 0xdd, 0x93, 0x32, 0x74, 0x17, 0x3c, 0x5c, 0xa7, 0xe5, 0x31, + 0xdb, 0xbc, 0x8d, 0xae, 0xfe, 0xf6, 0xfe, 0xe8, 0x40, 0xd7, 0xae, 0xce, 0x2c, 0x69, 0x21, 0xcb, + 0xce, 0x72, 0x96, 0x75, 0x33, 0x93, 0x64, 0xfc, 0x2c, 0x14, 0xec, 0x4d, 0x79, 0xa7, 0x81, 0x51, + 0x0d, 0xd9, 0x1b, 0x54, 0xfc, 0xa6, 0x43, 0x92, 0x9d, 0x88, 0xf2, 0x4e, 0x53, 0x61, 0xc8, 0x4e, + 0x84, 0xe2, 0x58, 0x8e, 0x63, 0x4c, 0x65, 0x7c, 0x16, 0x26, 0x59, 0xc4, 0x0e, 0x19, 0x46, 0xba, + 0x1a, 0x5a, 0x41, 0xaf, 0x34, 0x3c, 0xb3, 0x7a, 0xef, 0x2b, 0xf5, 0xaa, 0x36, 0x07, 0xaa, 0xfc, + 0x6d, 0xf5, 0x4c, 0x4c, 0xae, 0x51, 0xb5, 0x2a, 0xc4, 0xc6, 0x8f, 0x2a, 0x44, 0xf3, 0xa7, 0xa8, + 0x1d, 0x2c, 0xe8, 0x54, 0x4f, 0x3a, 0x65, 0x7d, 0x13, 0xc7, 0x5a, 0x30, 0xa7, 0x51, 0x2b, 0x8f, + 0xf0, 0x90, 0x16, 0xf1, 0xfc, 0xed, 0x50, 0x33, 0xb7, 0x83, 0x35, 0x2c, 0xfc, 0xc9, 0x58, 0xdf, + 0xe3, 0x18, 0x61, 0x2a, 0x19, 0x8d, 0xf5, 0xff, 0xb1, 0x79, 0x4a, 0x76, 0x16, 0x29, 0x99, 0x7c, + 0x04, 0x04, 0xd3, 0x31, 0x3f, 0xcb, 0x55, 0x05, 0xe5, 0x54, 0x88, 0x93, 0x8c, 0x47, 0xf6, 0x29, + 0xb9, 0x39, 0xb5, 0x1c, 0x58, 0x03, 0xb9, 0x05, 0x0d, 0x89, 0x29, 0x4d, 0xa5, 0x3d, 0x63, 0x56, + 0xb2, 0xf7, 0x8a, 0x28, 0x72, 0xe4, 0x36, 0xa6, 0x4d, 0x26, 0x86, 0x4a, 0x54, 0x0f, 0x51, 0x71, + 0x44, 0x77, 0x3f, 0xfd, 0x6c, 0xe6, 0xbe, 0x6e, 0x1e, 0xa2, 0x46, 0x5d, 0xfa, 0xf6, 0x9e, 0xc2, + 0xe6, 0x80, 0x09, 0x79, 0x90, 0xc5, 0x6c, 0x7c, 0x76, 0xed, 0xae, 0xc3, 0xfb, 0xbd, 0x03, 0x64, + 0xde, 0x8f, 0xfd, 0x8f, 0x33, 0xbb, 0x35, 0x9c, 0xcb, 0xdf, 0x1a, 0x1f, 0x40, 0x37, 0xd7, 0x6e, + 0x42, 0x96, 0x1e, 0x66, 0x65, 0xf6, 0x3a, 0x46, 0xa7, 0x62, 0x2b, 0xd4, 0xf3, 0x59, 0x05, 0x33, + 0xe4, 0x59, 0x8c, 0x26, 0x79, 0xed, 0xa0, 0xad, 0x34, 0x81, 0x52, 0x78, 0x13, 0xb8, 0x3d, 0x3c, + 0xca, 0x4e, 0xf6, 0xb2, 0xf4, 0x90, 0x4d, 0x0a, 0x73, 0x6d, 0xbe, 0xc3, 0xff, 0x08, 0x17, 0x9a, + 0x39, 0x95, 0xea, 0x4c, 0xd9, 0x1c, 0x95, 0xa2, 0xf7, 0x67, 0x07, 0xee, 0xac, 0x9a, 0xe9, 0x5d, + 0xb6, 0xbf, 0x0f, 0x6b, 0x63, 0xe3, 0xce, 0x78, 0xbb, 0xfc, 0x7f, 0xce, 0xc5, 0x71, 0xde, 0x53, + 0xa8, 0xe9, 0xe6, 0xe0, 0x21, 0x54, 0xb8, 0xd4, 0x2b, 0x58, 0xdf, 0xbd, 0xff, 0x16, 0xa6, 0x50, + 0x40, 0xfd, 0x78, 0xad, 0x70, 0x49, 0xba, 0xe0, 0x70, 0xbd, 0x53, 0x27, 0x70, 0xf8, 0x87, 0x7f, + 0x77, 0xa0, 0x55, 0x9a, 0xc9, 0x26, 0xac, 0xf9, 0xfe, 0x60, 0x6f, 0xca, 0x55, 0xbd, 0xef, 0x90, + 0x1e, 0x74, 0x7d, 0x7f, 0x70, 0x50, 0x76, 0x84, 0x3d, 0x87, 0x74, 0xa1, 0xe5, 0xfb, 0x03, 0x4d, + 0x3e, 0xbd, 0x8a, 0x95, 0x3e, 0x8f, 0x0b, 0x71, 0xd4, 0xab, 0x4e, 0x1d, 0x24, 0x39, 0x35, 0x0e, + 0x6a, 0x64, 0x0d, 0xda, 0xfe, 0xb3, 0x41, 0x3f, 0x15, 0xc8, 0x65, 0xaf, 0x6e, 0x45, 0x1f, 0x63, + 0x94, 0xd8, 0x6b, 0x90, 0x0d, 0xe8, 0xf8, 0xcf, 0x06, 0x4f, 0x8a, 0xf8, 0x95, 0xba, 0xc7, 0x7a, + 0x4d, 0x6d, 0x7f, 0x31, 0x30, 0x8f, 0x94, 0x5e, 0x4b, 0xbb, 0x7f, 0x31, 0x50, 0xcf, 0xa6, 0xb3, + 0x5e, 0xdb, 0x0e, 0xfe, 0x55, 0xae, 0x7d, 0xc1, 0x93, 0x47, 0xbf, 0xf9, 0x74, 0xc2, 0xe4, 0x51, + 0x31, 0x52, 0xf1, 0x7a, 0x68, 0xb6, 0xfe, 0x11, 0xcb, 0xec, 0xd7, 0xc3, 0x72, 0xfb, 0x0f, 0x75, + 0x34, 0xa6, 0x62, 0x3e, 0x1a, 0x35, 0xb4, 0xe6, 0x93, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc1, + 0x18, 0x48, 0x84, 0x88, 0x17, 0x00, 0x00, +} diff --git a/internal/proxy/lb_policy.go b/internal/proxy/lb_policy.go index 68617372f8795..7a5394863f761 100644 --- a/internal/proxy/lb_policy.go +++ b/internal/proxy/lb_policy.go @@ -32,7 +32,7 @@ import ( "github.com/milvus-io/milvus/pkg/util/typeutil" ) -type executeFunc func(context.Context, UniqueID, types.QueryNodeClient, ...string) error +type executeFunc func(context.Context, UniqueID, types.QueryNodeClient, string) error type ChannelWorkload struct { db string diff --git a/internal/proxy/lb_policy_test.go b/internal/proxy/lb_policy_test.go index b3a89ef5f5d9e..bf3c32c896de3 100644 --- a/internal/proxy/lb_policy_test.go +++ b/internal/proxy/lb_policy_test.go @@ -248,7 +248,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, retryTimes: 1, @@ -265,7 +265,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, retryTimes: 1, @@ -285,7 +285,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, retryTimes: 1, @@ -303,7 +303,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, retryTimes: 2, @@ -324,7 +324,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { counter++ if counter == 1 { return errors.New("fake error") @@ -349,7 +349,7 @@ func (s *LBPolicySuite) TestExecuteWithRetry() { channel: s.channels[0], shardLeaders: s.nodes, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { _, err := qn.Search(ctx, nil) return err }, @@ -370,7 +370,7 @@ func (s *LBPolicySuite) TestExecute() { collectionName: s.collectionName, collectionID: s.collectionID, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, }) @@ -383,7 +383,7 @@ func (s *LBPolicySuite) TestExecute() { collectionName: s.collectionName, collectionID: s.collectionID, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { // succeed in first execute if counter.Add(1) == 1 { return nil @@ -404,7 +404,7 @@ func (s *LBPolicySuite) TestExecute() { collectionName: s.collectionName, collectionID: s.collectionID, nq: 1, - exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, s ...string) error { + exec: func(ctx context.Context, ui UniqueID, qn types.QueryNodeClient, channel string) error { return nil }, }) diff --git a/internal/proxy/task_delete.go b/internal/proxy/task_delete.go index 2a0df673d8a38..fda28b75137de 100644 --- a/internal/proxy/task_delete.go +++ b/internal/proxy/task_delete.go @@ -350,7 +350,7 @@ func (dr *deleteRunner) produce(ctx context.Context, primaryKeys *schemapb.IDs) // getStreamingQueryAndDelteFunc return query function used by LBPolicy // make sure it concurrent safe func (dr *deleteRunner) getStreamingQueryAndDelteFunc(plan *planpb.PlanNode) executeFunc { - return func(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channelIDs ...string) error { + return func(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channel string) error { var partitionIDs []int64 // optimize query when partitionKey on @@ -375,7 +375,7 @@ func (dr *deleteRunner) getStreamingQueryAndDelteFunc(plan *planpb.PlanNode) exe log := log.Ctx(ctx).With( zap.Int64("collectionID", dr.collectionID), zap.Int64s("partitionIDs", partitionIDs), - zap.Strings("channels", channelIDs), + zap.String("channel", channel), zap.Int64("nodeID", nodeID)) // set plan @@ -405,7 +405,7 @@ func (dr *deleteRunner) getStreamingQueryAndDelteFunc(plan *planpb.PlanNode) exe OutputFieldsId: outputFieldIDs, GuaranteeTimestamp: parseGuaranteeTsFromConsistency(dr.ts, dr.ts, dr.req.GetConsistencyLevel()), }, - DmlChannels: channelIDs, + DmlChannels: []string{channel}, Scope: querypb.DataScope_All, } diff --git a/internal/proxy/task_delete_test.go b/internal/proxy/task_delete_test.go index 816b6aaa903c5..ca40dcea581e4 100644 --- a/internal/proxy/task_delete_test.go +++ b/internal/proxy/task_delete_test.go @@ -546,7 +546,7 @@ func TestDeleteRunner_Run(t *testing.T) { }, } lb.EXPECT().Execute(mock.Anything, mock.Anything).Call.Return(func(ctx context.Context, workload CollectionWorkLoad) error { - return workload.exec(ctx, 1, qn) + return workload.exec(ctx, 1, qn, "") }) qn.EXPECT().QueryStream(mock.Anything, mock.Anything).Return(nil, errors.New("mock error")) @@ -591,7 +591,7 @@ func TestDeleteRunner_Run(t *testing.T) { stream.EXPECT().Produce(mock.Anything).Return(nil) lb.EXPECT().Execute(mock.Anything, mock.Anything).Call.Return(func(ctx context.Context, workload CollectionWorkLoad) error { - return workload.exec(ctx, 1, qn) + return workload.exec(ctx, 1, qn, "") }) qn.EXPECT().QueryStream(mock.Anything, mock.Anything).Call.Return( @@ -654,7 +654,7 @@ func TestDeleteRunner_Run(t *testing.T) { mockMgr.EXPECT().getOrCreateDmlStream(mock.Anything).Return(stream, nil) mockMgr.EXPECT().getChannels(collectionID).Return(channels, nil) lb.EXPECT().Execute(mock.Anything, mock.Anything).Call.Return(func(ctx context.Context, workload CollectionWorkLoad) error { - return workload.exec(ctx, 1, qn) + return workload.exec(ctx, 1, qn, "") }) qn.EXPECT().QueryStream(mock.Anything, mock.Anything).Call.Return( @@ -716,7 +716,7 @@ func TestDeleteRunner_Run(t *testing.T) { mockMgr.EXPECT().getOrCreateDmlStream(mock.Anything).Return(stream, nil) mockMgr.EXPECT().getChannels(collectionID).Return(channels, nil) lb.EXPECT().Execute(mock.Anything, mock.Anything).Call.Return(func(ctx context.Context, workload CollectionWorkLoad) error { - return workload.exec(ctx, 1, qn) + return workload.exec(ctx, 1, qn, "") }) qn.EXPECT().QueryStream(mock.Anything, mock.Anything).Call.Return( @@ -797,7 +797,7 @@ func TestDeleteRunner_Run(t *testing.T) { mockMgr.EXPECT().getOrCreateDmlStream(mock.Anything).Return(stream, nil) mockMgr.EXPECT().getChannels(collectionID).Return(channels, nil) lb.EXPECT().Execute(mock.Anything, mock.Anything).Call.Return(func(ctx context.Context, workload CollectionWorkLoad) error { - return workload.exec(ctx, 1, qn) + return workload.exec(ctx, 1, qn, "") }) qn.EXPECT().QueryStream(mock.Anything, mock.Anything).Call.Return( @@ -899,7 +899,7 @@ func TestDeleteRunner_StreamingQueryAndDelteFunc(t *testing.T) { qn := mocks.NewMockQueryNodeClient(t) // witho out plan queryFunc := dr.getStreamingQueryAndDelteFunc(nil) - assert.Error(t, queryFunc(ctx, 1, qn)) + assert.Error(t, queryFunc(ctx, 1, qn, "")) }) t.Run("partitionKey mode get meta failed", func(t *testing.T) { @@ -938,7 +938,7 @@ func TestDeleteRunner_StreamingQueryAndDelteFunc(t *testing.T) { plan, err := planparserv2.CreateRetrievePlan(dr.schema.CollectionSchema, dr.req.Expr) assert.NoError(t, err) queryFunc := dr.getStreamingQueryAndDelteFunc(plan) - assert.Error(t, queryFunc(ctx, 1, qn)) + assert.Error(t, queryFunc(ctx, 1, qn, "")) }) t.Run("partitionKey mode get partition ID failed", func(t *testing.T) { @@ -981,6 +981,6 @@ func TestDeleteRunner_StreamingQueryAndDelteFunc(t *testing.T) { plan, err := planparserv2.CreateRetrievePlan(dr.schema.CollectionSchema, dr.req.Expr) assert.NoError(t, err) queryFunc := dr.getStreamingQueryAndDelteFunc(plan) - assert.Error(t, queryFunc(ctx, 1, qn)) + assert.Error(t, queryFunc(ctx, 1, qn, "")) }) } diff --git a/internal/proxy/task_hybrid_search.go b/internal/proxy/task_hybrid_search.go index 61da77861c8c6..7090bbdfb8c07 100644 --- a/internal/proxy/task_hybrid_search.go +++ b/internal/proxy/task_hybrid_search.go @@ -42,9 +42,10 @@ type hybridSearchTask struct { userOutputFields []string - qc types.QueryCoordClient - node types.ProxyComponent - lb LBPolicy + qc types.QueryCoordClient + node types.ProxyComponent + lb LBPolicy + queryChannelsTs map[string]Timestamp collectionID UniqueID @@ -296,7 +297,8 @@ func (t *hybridSearchTask) Requery() error { UseDefaultConsistency: t.request.GetUseDefaultConsistency(), } - return doRequery(t.ctx, t.collectionID, t.node, t.schema.CollectionSchema, queryReq, t.result) + // TODO:Xige-16 refine the mvcc functionality of hybrid search + return doRequery(t.ctx, t.collectionID, t.node, t.schema.CollectionSchema, queryReq, t.result, t.queryChannelsTs) } func rankSearchResultData(ctx context.Context, diff --git a/internal/proxy/task_query.go b/internal/proxy/task_query.go index 47d59d6174125..30a471168aa16 100644 --- a/internal/proxy/task_query.go +++ b/internal/proxy/task_query.go @@ -61,6 +61,8 @@ type queryTask struct { plan *planpb.PlanNode partitionKeyMode bool lb LBPolicy + channelsMvcc map[string]Timestamp + fastSkip bool } type queryParams struct { @@ -467,19 +469,33 @@ func (t *queryTask) PostExecute(ctx context.Context) error { return nil } -func (t *queryTask) queryShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channelIDs ...string) error { +func (t *queryTask) queryShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channel string) error { + needOverrideMvcc := false + mvccTs := t.MvccTimestamp + if len(t.channelsMvcc) > 0 { + mvccTs, needOverrideMvcc = t.channelsMvcc[channel] + // In fast mode, if there is no corresponding channel in channelsMvcc, quickly skip this query. + if !needOverrideMvcc && t.fastSkip { + return nil + } + } + retrieveReq := typeutil.Clone(t.RetrieveRequest) retrieveReq.GetBase().TargetID = nodeID + if needOverrideMvcc && mvccTs > 0 { + retrieveReq.MvccTimestamp = mvccTs + } + req := &querypb.QueryRequest{ Req: retrieveReq, - DmlChannels: channelIDs, + DmlChannels: []string{channel}, Scope: querypb.DataScope_All, } log := log.Ctx(ctx).With(zap.Int64("collection", t.GetCollectionID()), zap.Int64s("partitionIDs", t.GetPartitionIDs()), zap.Int64("nodeID", nodeID), - zap.Strings("channels", channelIDs)) + zap.String("channel", channel)) result, err := qn.Query(ctx, req) if err != nil { diff --git a/internal/proxy/task_search.go b/internal/proxy/task_search.go index b1ffd6a40b1cb..e1ea686c1b7bc 100644 --- a/internal/proxy/task_search.go +++ b/internal/proxy/task_search.go @@ -63,9 +63,10 @@ type searchTask struct { offset int64 resultBuf *typeutil.ConcurrentSet[*internalpb.SearchResults] - qc types.QueryCoordClient - node types.ProxyComponent - lb LBPolicy + qc types.QueryCoordClient + node types.ProxyComponent + lb LBPolicy + queryChannelsTs map[string]Timestamp } func getPartitionIDs(ctx context.Context, dbName string, collectionName string, partitionNames []string) (partitionIDs []UniqueID, err error) { @@ -488,6 +489,13 @@ func (t *searchTask) PostExecute(ctx context.Context) error { return err } + t.queryChannelsTs = make(map[string]uint64) + for _, r := range toReduceResults { + for ch, ts := range r.GetChannelsMvcc() { + t.queryChannelsTs[ch] = ts + } + } + if len(toReduceResults) >= 1 { MetricType = toReduceResults[0].GetMetricType() } @@ -545,20 +553,20 @@ func (t *searchTask) PostExecute(ctx context.Context) error { return nil } -func (t *searchTask) searchShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channelIDs ...string) error { +func (t *searchTask) searchShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channel string) error { searchReq := typeutil.Clone(t.SearchRequest) searchReq.GetBase().TargetID = nodeID req := &querypb.SearchRequest{ Req: searchReq, - DmlChannels: channelIDs, + DmlChannels: []string{channel}, Scope: querypb.DataScope_All, - TotalChannelNum: int32(len(channelIDs)), + TotalChannelNum: int32(1), } log := log.Ctx(ctx).With(zap.Int64("collection", t.GetCollectionID()), zap.Int64s("partitionIDs", t.GetPartitionIDs()), zap.Int64("nodeID", nodeID), - zap.Strings("channels", channelIDs)) + zap.String("channel", channel)) var result *internalpb.SearchResults var err error @@ -619,7 +627,7 @@ func (t *searchTask) Requery() error { QueryParams: t.request.GetSearchParams(), } - return doRequery(t.ctx, t.GetCollectionID(), t.node, t.schema.CollectionSchema, queryReq, t.result) + return doRequery(t.ctx, t.GetCollectionID(), t.node, t.schema.CollectionSchema, queryReq, t.result, t.queryChannelsTs) } func (t *searchTask) fillInEmptyResult(numQueries int64) { @@ -672,6 +680,7 @@ func doRequery(ctx context.Context, schema *schemapb.CollectionSchema, request *milvuspb.QueryRequest, result *milvuspb.SearchResults, + queryChannelsTs map[string]Timestamp, ) error { outputFields := request.GetOutputFields() pkField, err := typeutil.GetPrimaryFieldSchema(schema) @@ -680,7 +689,10 @@ func doRequery(ctx context.Context, } ids := result.GetResults().GetIds() plan := planparserv2.CreateRequeryPlan(pkField, ids) - + channelsMvcc := make(map[string]Timestamp) + for k, v := range queryChannelsTs { + channelsMvcc[k] = v + } qt := &queryTask{ ctx: ctx, Condition: NewTaskCondition(ctx), @@ -691,10 +703,12 @@ func doRequery(ctx context.Context, ), ReqID: paramtable.GetNodeID(), }, - request: request, - plan: plan, - qc: node.(*Proxy).queryCoord, - lb: node.(*Proxy).lbPolicy, + request: request, + plan: plan, + qc: node.(*Proxy).queryCoord, + lb: node.(*Proxy).lbPolicy, + channelsMvcc: channelsMvcc, + fastSkip: true, } queryResult, err := node.(*Proxy).query(ctx, qt) if err != nil { diff --git a/internal/proxy/task_search_test.go b/internal/proxy/task_search_test.go index 4da23d81763a3..f514dcd0aa89c 100644 --- a/internal/proxy/task_search_test.go +++ b/internal/proxy/task_search_test.go @@ -2061,7 +2061,7 @@ func TestSearchTask_Requery(t *testing.T) { lb := NewMockLBPolicy(t) lb.EXPECT().Execute(mock.Anything, mock.Anything).Run(func(ctx context.Context, workload CollectionWorkLoad) { - err = workload.exec(ctx, 0, qn) + err = workload.exec(ctx, 0, qn, "") assert.NoError(t, err) }).Return(nil) lb.EXPECT().UpdateCostMetrics(mock.Anything, mock.Anything).Return() @@ -2141,7 +2141,7 @@ func TestSearchTask_Requery(t *testing.T) { lb := NewMockLBPolicy(t) lb.EXPECT().Execute(mock.Anything, mock.Anything).Run(func(ctx context.Context, workload CollectionWorkLoad) { - _ = workload.exec(ctx, 0, qn) + _ = workload.exec(ctx, 0, qn, "") }).Return(fmt.Errorf("mock err 1")) node.lbPolicy = lb @@ -2175,7 +2175,7 @@ func TestSearchTask_Requery(t *testing.T) { lb := NewMockLBPolicy(t) lb.EXPECT().Execute(mock.Anything, mock.Anything).Run(func(ctx context.Context, workload CollectionWorkLoad) { - _ = workload.exec(ctx, 0, qn) + _ = workload.exec(ctx, 0, qn, "") }).Return(fmt.Errorf("mock err 1")) node.lbPolicy = lb diff --git a/internal/proxy/task_statistic.go b/internal/proxy/task_statistic.go index e423068829831..ec50b0a4daae4 100644 --- a/internal/proxy/task_statistic.go +++ b/internal/proxy/task_statistic.go @@ -273,19 +273,19 @@ func (g *getStatisticsTask) getStatisticsFromQueryNode(ctx context.Context) erro return nil } -func (g *getStatisticsTask) getStatisticsShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channelIDs ...string) error { +func (g *getStatisticsTask) getStatisticsShard(ctx context.Context, nodeID int64, qn types.QueryNodeClient, channel string) error { nodeReq := proto.Clone(g.GetStatisticsRequest).(*internalpb.GetStatisticsRequest) nodeReq.Base.TargetID = nodeID req := &querypb.GetStatisticsRequest{ Req: nodeReq, - DmlChannels: channelIDs, + DmlChannels: []string{channel}, Scope: querypb.DataScope_All, } result, err := qn.GetStatistics(ctx, req) if err != nil { log.Warn("QueryNode statistic return error", zap.Int64("nodeID", nodeID), - zap.Strings("channels", channelIDs), + zap.String("channel", channel), zap.Error(err)) globalMetaCache.DeprecateShardCache(g.request.GetDbName(), g.collectionName) return err @@ -293,7 +293,7 @@ func (g *getStatisticsTask) getStatisticsShard(ctx context.Context, nodeID int64 if result.GetStatus().GetErrorCode() == commonpb.ErrorCode_NotShardLeader { log.Warn("QueryNode is not shardLeader", zap.Int64("nodeID", nodeID), - zap.Strings("channels", channelIDs)) + zap.String("channel", channel)) globalMetaCache.DeprecateShardCache(g.request.GetDbName(), g.collectionName) return errInvalidShardLeaders } diff --git a/internal/querynodev2/delegator/delegator.go b/internal/querynodev2/delegator/delegator.go index c13f16e762dc1..c4ef2ef6b84fe 100644 --- a/internal/querynodev2/delegator/delegator.go +++ b/internal/querynodev2/delegator/delegator.go @@ -204,11 +204,14 @@ func (sd *shardDelegator) Search(ctx context.Context, req *querypb.SearchRequest // wait tsafe waitTr := timerecord.NewTimeRecorder("wait tSafe") - err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) + tSafe, err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) if err != nil { log.Warn("delegator search failed to wait tsafe", zap.Error(err)) return nil, err } + if req.GetReq().GetMvccTimestamp() == 0 { + req.Req.MvccTimestamp = tSafe + } metrics.QueryNodeSQLatencyWaitTSafe.WithLabelValues( fmt.Sprint(paramtable.GetNodeID()), metrics.SearchLabel). Observe(float64(waitTr.ElapseSpan().Milliseconds())) @@ -279,11 +282,14 @@ func (sd *shardDelegator) QueryStream(ctx context.Context, req *querypb.QueryReq // wait tsafe waitTr := timerecord.NewTimeRecorder("wait tSafe") - err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) + tSafe, err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) if err != nil { log.Warn("delegator query failed to wait tsafe", zap.Error(err)) return err } + if req.GetReq().GetMvccTimestamp() == 0 { + req.Req.MvccTimestamp = tSafe + } metrics.QueryNodeSQLatencyWaitTSafe.WithLabelValues( fmt.Sprint(paramtable.GetNodeID()), metrics.QueryLabel). Observe(float64(waitTr.ElapseSpan().Milliseconds())) @@ -347,11 +353,14 @@ func (sd *shardDelegator) Query(ctx context.Context, req *querypb.QueryRequest) // wait tsafe waitTr := timerecord.NewTimeRecorder("wait tSafe") - err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) + tSafe, err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) if err != nil { log.Warn("delegator query failed to wait tsafe", zap.Error(err)) return nil, err } + if req.GetReq().GetMvccTimestamp() == 0 { + req.Req.MvccTimestamp = tSafe + } metrics.QueryNodeSQLatencyWaitTSafe.WithLabelValues( fmt.Sprint(paramtable.GetNodeID()), metrics.QueryLabel). Observe(float64(waitTr.ElapseSpan().Milliseconds())) @@ -410,7 +419,7 @@ func (sd *shardDelegator) GetStatistics(ctx context.Context, req *querypb.GetSta } // wait tsafe - err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) + _, err := sd.waitTSafe(ctx, req.Req.GuaranteeTimestamp) if err != nil { log.Warn("delegator GetStatistics failed to wait tsafe", zap.Error(err)) return nil, err @@ -552,14 +561,15 @@ func executeSubTasks[T any, R interface { } // waitTSafe returns when tsafe listener notifies a timestamp which meet the guarantee ts. -func (sd *shardDelegator) waitTSafe(ctx context.Context, ts uint64) error { +func (sd *shardDelegator) waitTSafe(ctx context.Context, ts uint64) (uint64, error) { log := sd.getLogger(ctx) // already safe to search - if sd.latestTsafe.Load() >= ts { - return nil + latestTSafe := sd.latestTsafe.Load() + if latestTSafe >= ts { + return latestTSafe, nil } // check lag duration too large - st, _ := tsoutil.ParseTS(sd.latestTsafe.Load()) + st, _ := tsoutil.ParseTS(latestTSafe) gt, _ := tsoutil.ParseTS(ts) lag := gt.Sub(st) maxLag := paramtable.Get().QueryNodeCfg.MaxTimestampLag.GetAsDuration(time.Second) @@ -570,7 +580,7 @@ func (sd *shardDelegator) waitTSafe(ctx context.Context, ts uint64) error { zap.Duration("lag", lag), zap.Duration("maxTsLag", maxLag), ) - return WrapErrTsLagTooLarge(lag, maxLag) + return 0, WrapErrTsLagTooLarge(lag, maxLag) } ch := make(chan struct{}) @@ -592,12 +602,12 @@ func (sd *shardDelegator) waitTSafe(ctx context.Context, ts uint64) error { case <-ctx.Done(): // notify wait goroutine to quit sd.tsCond.Broadcast() - return ctx.Err() + return 0, ctx.Err() case <-ch: if !sd.Serviceable() { - return merr.WrapErrChannelNotAvailable(sd.vchannelName, "delegator closed during wait tsafe") + return 0, merr.WrapErrChannelNotAvailable(sd.vchannelName, "delegator closed during wait tsafe") } - return nil + return sd.latestTsafe.Load(), nil } } } diff --git a/internal/querynodev2/handlers.go b/internal/querynodev2/handlers.go index 194e9af151d84..c27dd7a64ea3b 100644 --- a/internal/querynodev2/handlers.go +++ b/internal/querynodev2/handlers.go @@ -398,7 +398,6 @@ func (node *QueryNode) searchChannel(ctx context.Context, req *querypb.SearchReq metrics.QueryNodeSQCount.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.SearchLabel, metrics.SuccessLabel, metrics.Leader).Inc() metrics.QueryNodeSearchNQ.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Observe(float64(req.Req.GetNq())) metrics.QueryNodeSearchTopK.WithLabelValues(fmt.Sprint(paramtable.GetNodeID())).Observe(float64(req.Req.GetTopk())) - return resp, nil } diff --git a/internal/querynodev2/segments/plan.go b/internal/querynodev2/segments/plan.go index 3b85862d82d52..08825618c62fb 100644 --- a/internal/querynodev2/segments/plan.go +++ b/internal/querynodev2/segments/plan.go @@ -84,6 +84,7 @@ type SearchRequest struct { cPlaceholderGroup C.CPlaceholderGroup msgID UniqueID searchFieldID UniqueID + mvccTimestamp Timestamp } func NewSearchRequest(ctx context.Context, collection *Collection, req *querypb.SearchRequest, placeholderGrp []byte) (*SearchRequest, error) { @@ -123,6 +124,7 @@ func NewSearchRequest(ctx context.Context, collection *Collection, req *querypb. cPlaceholderGroup: cPlaceholderGroup, msgID: req.GetReq().GetBase().GetMsgID(), searchFieldID: int64(fieldID), + mvccTimestamp: req.GetReq().GetMvccTimestamp(), } return ret, nil diff --git a/internal/querynodev2/segments/reduce_test.go b/internal/querynodev2/segments/reduce_test.go index 2381cdd54e803..f6a587821b5fc 100644 --- a/internal/querynodev2/segments/reduce_test.go +++ b/internal/querynodev2/segments/reduce_test.go @@ -35,6 +35,7 @@ import ( "github.com/milvus-io/milvus/pkg/common" "github.com/milvus-io/milvus/pkg/util/funcutil" "github.com/milvus-io/milvus/pkg/util/paramtable" + "github.com/milvus-io/milvus/pkg/util/typeutil" ) type ReduceSuite struct { @@ -168,6 +169,7 @@ func (suite *ReduceSuite) TestReduceAllFunc() { plan, err := createSearchPlanByExpr(context.Background(), suite.collection, serializedPlan, "") suite.NoError(err) searchReq, err := parseSearchRequest(context.Background(), plan, placeGroupByte) + searchReq.mvccTimestamp = typeutil.MaxTimestamp suite.NoError(err) defer searchReq.Delete() diff --git a/internal/querynodev2/segments/result.go b/internal/querynodev2/segments/result.go index 26a1197625c4a..1ed53aa8e0a1b 100644 --- a/internal/querynodev2/segments/result.go +++ b/internal/querynodev2/segments/result.go @@ -49,6 +49,12 @@ func ReduceSearchResults(ctx context.Context, results []*internalpb.SearchResult return results[0], nil } + channelsMvcc := make(map[string]uint64) + for _, r := range results { + for ch, ts := range r.GetChannelsMvcc() { + channelsMvcc[ch] = ts + } + } log := log.Ctx(ctx) searchResultData, err := DecodeSearchResults(results) @@ -88,7 +94,7 @@ func ReduceSearchResults(ctx context.Context, results []*internalpb.SearchResult return nil, false }) searchResults.CostAggregation = mergeRequestCost(requestCosts) - + searchResults.ChannelsMvcc = channelsMvcc return searchResults, nil } diff --git a/internal/querynodev2/segments/segment.go b/internal/querynodev2/segments/segment.go index efec5ddd2b97e..e66ee8419534e 100644 --- a/internal/querynodev2/segments/segment.go +++ b/internal/querynodev2/segments/segment.go @@ -388,6 +388,7 @@ func (s *LocalSegment) Search(ctx context.Context, searchReq *SearchRequest) (*S searchReq.plan.cSearchPlan, searchReq.cPlaceholderGroup, traceCtx, + C.uint64_t(searchReq.mvccTimestamp), &searchResult.cSearchResult, ) metrics.QueryNodeSQSegmentLatencyInCore.WithLabelValues(fmt.Sprint(paramtable.GetNodeID()), metrics.SearchLabel).Observe(float64(tr.ElapseSpan().Milliseconds())) diff --git a/internal/querynodev2/services.go b/internal/querynodev2/services.go index a1e7091da867c..a963622604e9d 100644 --- a/internal/querynodev2/services.go +++ b/internal/querynodev2/services.go @@ -656,8 +656,13 @@ func (node *QueryNode) SearchSegments(ctx context.Context, req *querypb.SearchRe zap.String("channel", channel), zap.String("scope", req.GetScope().String()), ) - - resp := &internalpb.SearchResults{} + channelsMvcc := make(map[string]uint64) + for _, ch := range req.GetDmlChannels() { + channelsMvcc[ch] = req.GetReq().GetMvccTimestamp() + } + resp := &internalpb.SearchResults{ + ChannelsMvcc: channelsMvcc, + } if err := node.lifetime.Add(merr.IsHealthy); err != nil { resp.Status = merr.Status(err) return resp, nil @@ -733,7 +738,8 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) ( log.Debug("Received SearchRequest", zap.Int64s("segmentIDs", req.GetSegmentIDs()), - zap.Uint64("guaranteeTimestamp", req.GetReq().GetGuaranteeTimestamp())) + zap.Uint64("guaranteeTimestamp", req.GetReq().GetGuaranteeTimestamp()), + zap.Uint64("mvccTimestamp", req.GetReq().GetMvccTimestamp())) tr := timerecord.NewTimeRecorderWithTrace(ctx, "SearchRequest") @@ -763,6 +769,7 @@ func (node *QueryNode) Search(ctx context.Context, req *querypb.SearchRequest) ( toReduceResults := make([]*internalpb.SearchResults, len(req.GetDmlChannels())) runningGp, runningCtx := errgroup.WithContext(ctx) + for i, ch := range req.GetDmlChannels() { ch := ch req := &querypb.SearchRequest{ diff --git a/internal/querynodev2/services_test.go b/internal/querynodev2/services_test.go index e74f723ae3819..c8048ebca5aa7 100644 --- a/internal/querynodev2/services_test.go +++ b/internal/querynodev2/services_test.go @@ -1144,6 +1144,7 @@ func (suite *ServiceSuite) genCSearchRequest(nq int64, dataType schemapb.DataTyp PlaceholderGroup: placeHolder, DslType: commonpb.DslType_BoolExprV1, Nq: nq, + MvccTimestamp: typeutil.MaxTimestamp, }, nil } diff --git a/internal/querynodev2/tasks/task.go b/internal/querynodev2/tasks/task.go index 9fbf12545a464..83498157a2764 100644 --- a/internal/querynodev2/tasks/task.go +++ b/internal/querynodev2/tasks/task.go @@ -257,6 +257,7 @@ func (t *SearchTask) Merge(other *SearchTask) bool { // Check mergeable if t.req.GetReq().GetDbID() != other.req.GetReq().GetDbID() || t.req.GetReq().GetCollectionID() != other.req.GetReq().GetCollectionID() || + t.req.GetReq().GetMvccTimestamp() != other.req.GetReq().GetMvccTimestamp() || t.req.GetReq().GetDslType() != other.req.GetReq().GetDslType() || t.req.GetDmlChannels()[0] != other.req.GetDmlChannels()[0] || nq+otherNq > paramtable.Get().QueryNodeCfg.MaxGroupNQ.GetAsInt64() || @@ -300,6 +301,13 @@ func (t *SearchTask) Wait() error { } func (t *SearchTask) Result() *internalpb.SearchResults { + if t.result != nil { + channelsMvcc := make(map[string]uint64) + for _, ch := range t.req.GetDmlChannels() { + channelsMvcc[ch] = t.req.GetReq().GetMvccTimestamp() + } + t.result.ChannelsMvcc = channelsMvcc + } return t.result }