Repository navigation
[search source] remove is_partial check - #164506
Conversation
…-ref HEAD~1..HEAD --fix'
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
`data.search` uses [poll_search](https://github.com/elastic/kibana/blob/main/src/plugins/data/common/search/poll_search.ts) to fetch data. `poll_search` checks for `isErrorResponse` and throws when`isErrorResponse` is true. **Note** `searchSource.search` uses `data.search` to perform searches. ```javascript return from(search()).pipe( expand(() => { const elapsedTime = Date.now() - startTime; return timer(getPollInterval(elapsedTime)).pipe(switchMap(search)); }), tap((response) => { if (isErrorResponse(response)) { throw response ? new Error('Received partial response') : new AbortError(); } }), takeWhile<Response>(isPartialResponse, true), takeUntil<Response>(aborted$) ); ``` Subscribers to `data.search` and `searchSource.search` do not need to check for `isErrorResponse` in `next`. `poll_search` has already thrown then the response is `isErrorResponse` so these checks are dead code blocks that are never executed. This PR removes these dead code blocks. Breaking this change out of #164506 so that it can be reviewed in isolated. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
|
Pinging @elastic/uptime (Team:uptime) |
|
@elasticmachine merge upstream |
lukasolson
left a comment
There was a problem hiding this comment.
Added a couple of minor comments below, overall LGTM!
stratoula
left a comment
There was a problem hiding this comment.
The Visualizations team review was asked due to co-ownership with the discovery team. Lukas approval will be enough to allow merging as all changes are search related and the discovery team owns them 👍
PhilippeOberti
left a comment
There was a problem hiding this comment.
LGTM for the Protections Experience and the Threat Hunting Investigations teams!
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Closes #164893
Background
"is partial" has 2 meanings
async search defines 2 flags.
is_running: Whether the search is still being executed or it has completedis_partial: When the query is no longer running, indicates whether the search failed or was successfully completed on all shards. While the query is being executed, is_partial is always set to truenote: there is a bug in async search where requests to only local clusters return
is_partial:falsewhen there are shard errors on the local cluster. See async search returns is_partial:false when local cluster has shard errors elasticsearch#98725. This should be resolved in 8.11Kibana's existing search implementation does not align with Elasticsearch's
is_runningandis_partialflags. Kibana defines "is partial" as definition "1)". Elasticsearch async search defines "is partial" as definition "2)".This PR aligns Kibana's usage of "is partial" with Elasticsearch's definition. This required the following changes
isErrorResponserenamed toisAbortedResponse. Method no longer returns true when!response.isRunning && !!response.isPartial. Kibana handles results with incomplete data. Note removed export ofisErrorResponsefrom data plugin since its use outside of data plugin does not make sense.isPartialResponsewithisRunningResponse. This aligns Kibana's definition with Elasticsearch async search flags.isCompleteResponse. The word "complete" is ambiguous. Does it mean the search is finished (no longer running)? Or does it mean the search has all results and there are no shard failures?