-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add field for warnings (and maybe debug/info?) to SearchResponse #6794
Comments
Rather than additional info, I propose that
I feel pretty strongly that this was the right option because as a user I don't want results that are "sometimes better ranked", I like my systems to be predictable. But I also do understand that calling out to Kendra isn't like all other rerankers because there's some networking involved, and I also understand a website may want some kind of fallback. So I can see how some administrators may want this behavior to be optional - there's another feature request here to support both hard failure and the current behavior. |
I don't think Maybe we could add levels of verbosity to the |
@msfroh Is it a problem that |
Yeah, I guess it's not a problem. I'm not a fan of the wall of text from explaining scores (and I don't usually need score explanations unless I'm specifically investigating a relevance issue), but sure, we can put all the debug, info, and warning stuff in one place. |
I do like the idea of adding more options to limit the depth/verbosity of explain, too! But that's a different feature. |
I was looking into this a bit more, and the I still don't know where we could put additional (debug/warning) information about query processing, but explain is definitely not the right API. |
@msfroh Just because something is implemented in a certain way doesn't mean it's not what users want an API to return. What would our users want? Then we can discuss the implementation. |
I don't believe that our users would want a scoring-focused API to start returning things unrelated to scoring. |
That is indeed what Another related set of concerns may be #1061? |
#1061 is probably closer to what we're looking for here. Following that issue... |
In opensearch-project/ml-commons#1150, @austintlee suggested the possible addition of an |
I just created a PR and am looking to get feedback on that. Thanks. |
reading through the context, I like free form |
Is your feature request related to a problem? Please describe.
When calling out to an external reranker, it's possible that the network call fails (because networks). For our plugin that calls out to AWS Kendra Intelligent Ranking service, we swallow and log any exceptions, and just return results in the original order. While the server-side application log captures what went wrong, the client who made the search request has no way of knowing that they're receiving degraded results.
More broadly, this will be a problem for any search pipeline processor that makes an external call and wants to "fail open", as called out in a comment by @lukas-vlcek on opensearch-project/search-processor#80.
Describe the solution you'd like
The best solution I've been able to come up with so far is that the search response could include an extra "warnings" property. This could be an array of strings (or objects?).
Ideally, any warnings could communicate what failed and why, so that a human observing these warnings might be able to take corrective action. For example, a call to an external service may have failed because credentials are no longer valid, or a call quota was exceeded.
For now, I'm leaning toward human-readable string warnings, since I haven't thought of a reason to make them machine-friendly (though that may just be a lack of imagination on my part).
Describe alternatives you've considered
The status quo, where we log the warning to application logs "works", but it assumes that callers who may not have access to the application logs don't need to know if a specific response was degraded.
Another option would be to recommend always "failing closed". That is, if a call to an external reranker fails, then just throw an exception (with explanation) instead of returning results. That's bad from an availability standpoint.
We could also optionally fail closed (i.e. via a request parameter), so production traffic fails open, but a "canary" service periodically probes the search cluster asking for an exception if the external call fails. That only works if the canary calls fail the same way as the production traffic calls.
Additional context
As a stretch goal, I think we could generalize this to include messages at other "log levels". In particular, it has always bothered me that OpenSearch and its predecessor don't have a
debug
URL parameter for search requests, the way that Solr has since forever.Maybe this search response property could have a form like:
The text was updated successfully, but these errors were encountered: