-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Refactor, deangularize courier/search source #45235
Conversation
Pinging @elastic/kibana-app-arch |
|
||
await respondToSearchRequests(responsesInOriginalRequestOrder); | ||
} catch(error) { | ||
if (errorAllowExplicitIndex.test(error)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now if you set rest.action.multi.allow_explicit_index
to false
in your elasticsearch.yml, a lot of things are broken (including the saved objects client and add sample data). I don't see any reason to explicitly handle this here because the apps also rely on the saved objects client, which doesn't handle this. Maybe we should open an issue to better handle this scenario from a higher level.
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
💔 Build Failed |
💚 Build Succeeded |
💚 Build Succeeded |
Summary
This PR prepares search source for migration to the new platform and to the new search APIs.
Resolves #44659.
Resolves #44738.
Removal of search request
The
SearchRequest
module added a lot of complications to the way requests were processed, and included behavior that was never used (like lifecycle events andcontinueIncomplete
). It was a confusing construct that had two different promises that might resolve at any given point but really just represented a success or a failure. This PR removes theSearchRequest
class (in addition toRequestStatus
andIsRequest
) and instead passes the actual Elasticsearch request DSL object directly to the search strategy.Removal of search request queue
This was really just an array, and was only helpful when courier was destroyed so all current requests could be aborted. Now it's the responsibility of the caller of
fetch
to abort the request. The array of requests to process can now be found infetchSoon
.Allow passing
abortSignal
tosearchSource.fetch
This PR removes the previous way for a search source to abort an in-progress request,
cancelQueued
, in favor of passing anabortSignal
to thefetch
method. This allows the caller offetch
to more easily control when a request should be aborted, and is in line with how we handle aborting other things (like the interpreter and ES cluster client).Refactoring of
callClient
The
callClient
module used to do things in a very funky way. It would conditionally respond to requests with either a response, or anABORTED
constant. This caused a lot of conditional handling or requests/responses. Now, instead of responding with disparate values, it will eitherresolve
with the response orreject
with an error, which in the case of an aborted request, is anAbortError
.For testers
This PR affects the querying of Elasticsearch in many places that should be tested:
It's also important to test these areas in conjunction with other things that affect the Elasticsearch query, like KQL/Lucene, filters, and time ranges (including auto-refresh intervals).
It also affects the creation of new index patterns, which should also be tested.
Checklist
For maintainers