diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-12-12 16:57:12 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-12-12 16:57:12 +0000 |
commit | a6827b11b0c79eb61a69b48a2cd2a313b31d590d (patch) | |
tree | b07354bf543b93763e76c1f13824977b95689e6f | |
parent | 790d5c8961f7bc8037d9de31dcd80e03922bc1da (diff) |
Follow config if using supplied thread bundle or not.
6 files changed, 22 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp index 51d96c5a843..a3d2a9b33d9 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/attribute_limiter.cpp @@ -100,8 +100,9 @@ AttributeLimiter::create_match_data(size_t want_hits, size_t max_group_size, dou field.add(FieldSpec(_attribute_name, my_field_id, my_handle)); _blueprint = _searchable_attributes.createBlueprint(_requestContext, field, node); //TODO use_estimate must be switched to true quite soon + //TODO Use thread_bundle once verified(soon), _requestContext.thread_bundle() auto execInfo = ExecuteInfo::create(strictSearch, strictSearch ? 1.0 : hit_rate, &_requestContext.getDoom(), - _requestContext.thread_bundle(), true, false); + vespalib::ThreadBundle::trivial(), true, false); _blueprint->fetchPostings(execInfo); _estimatedHits.store(_blueprint->getState().estimate().estHits, std::memory_order_relaxed); _blueprint->freeze(); diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index 527f7702a7c..920af030c74 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -208,7 +208,9 @@ MatchToolsFactory(QueryLimiter & queryLimiter, double hitRate = std::min(1.0, double(maxNumHits)/double(searchContext.getDocIdLimit())); bool create_postinglist_when_non_strict = CreatePostingListWhenNonStrict::check(_queryEnv.getProperties(), rankSetup.create_postinglist_when_non_strict()); bool use_estimate_for_fetch_postings = UseEstimateForFetchPostings::check(_queryEnv.getProperties(), rankSetup.use_estimate_for_fetch_postings()); - _query.fetchPostings(ExecuteInfo::create(is_search, hitRate, &_requestContext.getDoom(), thread_bundle, + bool use_thread_bundle_for_fetch_postings = UseThreadBundleForFetchPostings::check(_queryEnv.getProperties(), rankSetup.use_thread_bundle_for_fetch_postings()); + _query.fetchPostings(ExecuteInfo::create(is_search, hitRate, &_requestContext.getDoom(), + use_thread_bundle_for_fetch_postings ? thread_bundle : vespalib::ThreadBundle::trivial(), create_postinglist_when_non_strict, use_estimate_for_fetch_postings)); if (is_search) { _query.handle_global_filter(_requestContext, searchContext.getDocIdLimit(), diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp index 637c197b303..cd9dbff99cb 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp @@ -473,6 +473,12 @@ bool UseEstimateForFetchPostings::check(const Properties &props, bool fallback) return lookupBool(props, NAME, fallback); } +const vespalib::string UseThreadBundleForFetchPostings::NAME("vespa.matching.use_thread_bundle_for_fetch_postings"); +const bool UseThreadBundleForFetchPostings::DEFAULT_VALUE(false); +bool UseThreadBundleForFetchPostings::check(const Properties &props, bool fallback) { + return lookupBool(props, NAME, fallback); +} + } // namespace matching namespace softtimeout { diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h index 16046709d7e..0183fdf1a13 100644 --- a/searchlib/src/vespa/searchlib/fef/indexproperties.h +++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h @@ -367,6 +367,13 @@ namespace matching { static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); } static bool check(const Properties &props, bool fallback); }; + + struct UseThreadBundleForFetchPostings { + static const vespalib::string NAME; + static const bool DEFAULT_VALUE; + static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); } + static bool check(const Properties &props, bool fallback); + }; } namespace softtimeout { diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp index 1f30a3b59e9..5c28f1814d5 100644 --- a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp +++ b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp @@ -63,6 +63,7 @@ RankSetup::RankSetup(const BlueprintFactory &factory, const IIndexEnvironment &i _always_mark_phrase_expensive(false), _create_postinglist_when_non_strict(true), _use_estimate_for_fetch_postings(false), + _use_thread_bundle_for_fetch_postings(false), _diversityAttribute(), _diversityMinGroups(1), _diversityCutoffFactor(10.0), @@ -139,6 +140,7 @@ RankSetup::configure() _always_mark_phrase_expensive = matching::AlwaysMarkPhraseExpensive::check(_indexEnv.getProperties()); _create_postinglist_when_non_strict = matching::CreatePostingListWhenNonStrict::check(_indexEnv.getProperties()); _use_estimate_for_fetch_postings = matching::UseEstimateForFetchPostings::check(_indexEnv.getProperties()); + _use_thread_bundle_for_fetch_postings = matching::UseThreadBundleForFetchPostings::check(_indexEnv.getProperties()); } void diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.h b/searchlib/src/vespa/searchlib/fef/ranksetup.h index 8e4a6c4246e..04659955490 100644 --- a/searchlib/src/vespa/searchlib/fef/ranksetup.h +++ b/searchlib/src/vespa/searchlib/fef/ranksetup.h @@ -72,6 +72,7 @@ private: bool _always_mark_phrase_expensive; bool _create_postinglist_when_non_strict; bool _use_estimate_for_fetch_postings; + bool _use_thread_bundle_for_fetch_postings; vespalib::string _diversityAttribute; uint32_t _diversityMinGroups; double _diversityCutoffFactor; @@ -226,6 +227,7 @@ public: bool always_mark_phrase_expensive() const noexcept { return _always_mark_phrase_expensive; } bool create_postinglist_when_non_strict() const noexcept { return _create_postinglist_when_non_strict; } bool use_estimate_for_fetch_postings() const noexcept { return _use_estimate_for_fetch_postings; } + bool use_thread_bundle_for_fetch_postings() const noexcept { return _use_thread_bundle_for_fetch_postings; } /** get number of hits to collect during graceful degradation in match phase */ uint32_t getDegradationMaxHits() const { return _degradationMaxHits; |