summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2021-10-21 15:44:29 +0200
committerGitHub <noreply@github.com>2021-10-21 15:44:29 +0200
commit44030f533278a9ffa071779c057511be12ec3c8d (patch)
tree81ac49b27510deabfac10d74b285982e8b464aee /searchcore
parent00cd069173c9c4d7a8da17eb093f013374a0616e (diff)
parentb764ec9a3e44d28a75fc0f748039a8326ff0617c (diff)
Merge pull request #19654 from vespa-engine/arnej/allow-discarding-issues
add forward_issues config option
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/config/proton.def3
-rw-r--r--searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/matchengine/matchengine.h3
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp9
-rw-r--r--searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.h3
6 files changed, 30 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/config/proton.def b/searchcore/src/vespa/searchcore/config/proton.def
index c1ec37e5662..e1bdf13fd36 100644
--- a/searchcore/src/vespa/searchcore/config/proton.def
+++ b/searchcore/src/vespa/searchcore/config/proton.def
@@ -514,3 +514,6 @@ bucketdb.checksumtype enum {LEGACY, XXHASH64} default = LEGACY restart
## FAST_VALUE uses the new and optimized FastValueBuilderFactory instead.
## TODO: Remove when default has been switched to FAST_VALUE.
tensor_implementation enum {TENSOR_ENGINE, FAST_VALUE} default = FAST_VALUE
+
+## Whether to report issues back to the container via protobuf field
+forward_issues bool default = true
diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
index 3aedd952d1e..5ad4a7ed52b 100644
--- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.cpp
@@ -46,6 +46,7 @@ MatchEngine::MatchEngine(size_t numThreads, size_t threadsPerSearch, uint32_t di
_distributionKey(distributionKey),
_async(async),
_closed(false),
+ _forward_issues(true),
_handlers(),
_executor(std::max(size_t(1), numThreads / threadsPerSearch), 256_Ki, match_engine_executor),
_threadBundlePool(std::max(size_t(1), threadsPerSearch)),
@@ -146,7 +147,13 @@ MatchEngine::performSearch(search::engine::SearchRequest::Source req)
_threadBundlePool.release(std::move(threadBundle));
}
ret->request = req.release();
- ret->my_issues = std::move(my_issues);
+ if (_forward_issues) {
+ ret->my_issues = std::move(my_issues);
+ } else {
+ my_issues->for_each_message([](const auto &msg){
+ LOG(warning, "unhandled issue: %s", msg.c_str());
+ });
+ }
ret->setDistributionKey(_distributionKey);
if ((ret->request->trace().getLevel() > 0) && ret->request->trace().hasTrace()) {
ret->request->trace().getRoot().setLong("distribution-key", _distributionKey);
diff --git a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.h b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.h
index 74a39a3ec78..b4e32c45003 100644
--- a/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.h
+++ b/searchcore/src/vespa/searchcore/proton/matchengine/matchengine.h
@@ -21,6 +21,7 @@ private:
const uint32_t _distributionKey;
bool _async;
bool _closed;
+ std::atomic<bool> _forward_issues;
HandlerMap<ISearchHandler> _handlers;
vespalib::ThreadStackExecutor _executor;
vespalib::SimpleThreadBundle::Pool _threadBundlePool;
@@ -137,6 +138,8 @@ public:
search::engine::SearchClient &client) override;
void get_state(const vespalib::slime::Inserter &inserter, bool full) const override;
+
+ void set_issue_forwarding(bool enable) { _forward_issues = enable; }
};
} // namespace proton
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index edf68633124..116ce072700 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -296,8 +296,10 @@ Proton::init(const BootstrapConfig::SP & configSnapshot)
protonConfig.numthreadspersearch,
protonConfig.distributionkey,
protonConfig.search.async);
+ _matchEngine->set_issue_forwarding(protonConfig.forwardIssues);
_distributionKey = protonConfig.distributionkey;
- _summaryEngine= std::make_unique<SummaryEngine>(protonConfig.numsummarythreads, protonConfig.docsum.async);
+ _summaryEngine = std::make_unique<SummaryEngine>(protonConfig.numsummarythreads, protonConfig.docsum.async);
+ _summaryEngine->set_issue_forwarding(protonConfig.forwardIssues);
_docsumBySlime = std::make_unique<DocsumBySlime>(*_summaryEngine);
IFlushStrategy::SP strategy;
@@ -385,6 +387,8 @@ Proton::applyConfig(const BootstrapConfig::SP & configSnapshot)
// Called by executor thread during reconfig.
const ProtonConfig &protonConfig = configSnapshot->getProtonConfig();
setFS4Compression(protonConfig);
+ _matchEngine->set_issue_forwarding(protonConfig.forwardIssues);
+ _summaryEngine->set_issue_forwarding(protonConfig.forwardIssues);
_queryLimiter.configure(protonConfig.search.memory.limiter.maxthreads,
protonConfig.search.memory.limiter.mincoverage,
diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp
index ec5c8c9b72d..95643c7d1a8 100644
--- a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.cpp
@@ -59,6 +59,7 @@ SummaryEngine::SummaryEngine(size_t numThreads, bool async)
: _lock(),
_async(async),
_closed(false),
+ _forward_issues(true),
_handlers(),
_executor(numThreads, 128_Ki, summary_engine_executor),
_metrics(std::make_unique<DocsumMetrics>())
@@ -145,7 +146,13 @@ SummaryEngine::getDocsums(DocsumRequest::UP req)
reply = std::make_unique<DocsumReply>();
}
reply->setRequest(std::move(req));
- reply->setIssues(std::move(my_issues));
+ if (_forward_issues) {
+ reply->setIssues(std::move(my_issues));
+ } else {
+ my_issues->for_each_message([](const auto &msg){
+ LOG(warning, "unhandled issue: %s", msg.c_str());
+ });
+ }
return reply;
}
diff --git a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.h b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.h
index 34eebdc839d..7f6d9328491 100644
--- a/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.h
+++ b/searchcore/src/vespa/searchcore/proton/summaryengine/summaryengine.h
@@ -34,6 +34,7 @@ private:
std::mutex _lock;
bool _async;
bool _closed;
+ std::atomic<bool> _forward_issues;
HandlerMap<ISearchHandler> _handlers;
vespalib::ThreadStackExecutor _executor;
std::unique_ptr<metrics::MetricSet> _metrics;
@@ -126,6 +127,8 @@ public:
DocsumReply::UP getDocsums(DocsumRequest::UP req) override;
metrics::MetricSet & getMetrics() { return *_metrics; }
+
+ void set_issue_forwarding(bool enable) { _forward_issues = enable; }
};
} // namespace proton