-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ES|QL async queries: Partial result on demand #118122
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
Merged
Merged
Changes from 94 commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
ff822ef
Add capability to stop async query on demand
smalyshev e2e761b
Add test skeleton
smalyshev 932d0f9
Add security check
smalyshev beb7b02
Allow close exchange early
dnhatn f7e1d9c
Fix tests
dnhatn bada285
Add query interruption
smalyshev 867a46c
spotless
smalyshev ccd6d34
code cleanup
smalyshev 406d1a0
Add action to non-op list
smalyshev 188dedb
Merge branch 'main' into partial-result-on-demand
smalyshev 124e070
Wait for the listener to complete
smalyshev 0ce939b
Allow early termination in Driver
dnhatn 516abbe
Capture partial status
smalyshev b53e1f1
Merge branch 'pr/118211' into partial-result-on-demand
smalyshev 514e22d
Ensure remote pipeline early termination
smalyshev 49c768e
fix tests
smalyshev 85220a7
Merge branch 'main' into partial-result-on-demand
smalyshev 1a93f9f
more test fixes
smalyshev ab08912
test fix
smalyshev 4e5b3de
Merge branch 'main' into partial-result-on-demand
smalyshev b4729eb
More tests
smalyshev ddb8794
Plugin refactoring
smalyshev 02a440c
Merge branch 'main' into partial-result-on-demand
smalyshev ebb4cd1
More tests
smalyshev 93c5543
Merge branch 'main' into partial-result-on-demand
smalyshev bbdcdec
More tests
smalyshev cb3620a
Update docs/changelog/118122.yaml
smalyshev 1b462b7
More tests
smalyshev a6185d7
test fix
smalyshev a6da813
Merge branch 'main' into partial-result-on-demand
smalyshev 10c0d02
Update 118122.yaml
smalyshev e928e10
Merge branch 'main' into partial-result-on-demand
smalyshev ab37d10
Merge branch 'main' into partial-result-on-demand
smalyshev 4a94c15
Feedback
smalyshev 605a5ee
[CI] Auto commit changes from spotless
8035e41
Merge branch 'main' into partial-result-on-demand
smalyshev a488391
Improve handling of PARTIAL results
smalyshev 6b949fe
Merge branch 'main' into partial-result-on-demand
smalyshev 6d41758
Fix tests - we do need to serialize isPartial in exec info
smalyshev d310ba4
Add checks for delay() usage
smalyshev 8bd844f
Merge branch 'main' into partial-result-on-demand
smalyshev a120670
add comments
smalyshev 812322b
Merge branch 'main' into partial-result-on-demand
smalyshev f781e7a
[CI] Auto commit changes from spotless
fc4d476
Add JSON defs for stop endpoint
smalyshev d65f173
Add docs
smalyshev 9098c82
fix tests
smalyshev 6f58544
fix API name
smalyshev a44da7b
add is_partial back, somehow it got dropped
smalyshev 0db9d98
Add async stop telemetry test
smalyshev 9712367
Merge branch 'main' into partial-result-on-demand
smalyshev 145a07e
Fix bad id test
smalyshev 3cb2527
Merge branch 'main' into partial-result-on-demand
smalyshev 391253f
Delete async search at the end of the test
smalyshev 080e1ba
Merge branch 'main' into partial-result-on-demand
smalyshev d86acb4
Remove DriverEarlyTerminationException
smalyshev e9559fe
Merge branch 'main' into partial-result-on-demand
smalyshev 7ccc749
Cleanup partial status handling
smalyshev a67234c
Refine skipped checks
smalyshev 9ab0207
Merge branch 'main' into partial-result-on-demand
smalyshev 65bf5a5
Cleanup & some docs
smalyshev d1160b6
Merge branch 'main' into partial-result-on-demand
smalyshev e739670
Remove onFinishEarly and use EsqlQueryListener instead
smalyshev ebeeaf4
remove micro-optimization
smalyshev 8900a9e
Merge branch 'main' into partial-result-on-demand
smalyshev 4e9a17a
Use new listener class
smalyshev c66b630
Merge branch 'main' into partial-result-on-demand
smalyshev c7a3e3d
Add test to ensure we early terminate
smalyshev c5bf7c3
[CI] Auto commit changes from spotless
291394e
Merge branch 'main' into partial-result-on-demand
smalyshev c49262f
Remove setSource as superceded by https://github.com/elastic/elastics…
smalyshev 765b8ff
[CI] Auto commit changes from spotless
ba0c337
Pull feedback
smalyshev 18bb7d5
fix test
smalyshev c24721a
Docs improvements
smalyshev 3b2cf6a
Merge branch 'main' into partial-result-on-demand
smalyshev 7416227
Remove timeout
smalyshev 6c98a2c
Merge branch 'main' into partial-result-on-demand
smalyshev 280edcd
[CI] Auto commit changes from spotless
1665d43
Restore the wait time
smalyshev 2bfad31
Merge branch 'main' into partial-result-on-demand
8825fe5
Move is_partial to the top dir
smalyshev be1badf
Fix esql tests to allow is_partial in result
smalyshev d74b79e
Merge branch 'main' into partial-result-on-demand
smalyshev c83f913
Merge branch 'main' into partial-result-on-demand
smalyshev 5d9056e
test fixes
smalyshev 58d1b98
test fixes
smalyshev 3814c2f
Merge branch 'main' into partial-result-on-demand
smalyshev 7fb5e63
test fix
smalyshev 94e4e07
test fix
smalyshev bea45e3
Merge branch 'main' into partial-result-on-demand
smalyshev ed26482
Fix doc tests
smalyshev 10da662
Merge branch 'main' into partial-result-on-demand
smalyshev dc31690
Merge branch 'main' into partial-result-on-demand
smalyshev 3d82200
pull feedback
smalyshev bcfca2b
Merge remote-tracking branch 'elastic/main' into fork/smalyshev/parti…
dnhatn d08313a
cluster status
dnhatn fb33318
better status
dnhatn 058705f
wait for local cluster
dnhatn 58ea6c7
Merge remote-tracking branch 'elastic/main' into fork/smalyshev/parti…
dnhatn 8d27af8
NPE
dnhatn 99d5eb4
fix tests
dnhatn 80087f5
restore the stop query check
smalyshev cd5c4a7
Merge branch 'main' into partial-result-on-demand
smalyshev 9d97471
Merge branch 'main' into partial-result-on-demand
smalyshev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 118122 | ||
| summary: "ES|QL: Partial result on demand for async queries" | ||
| area: ES|QL | ||
| type: enhancement | ||
| issues: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| [[esql-async-query-stop-api]] | ||
| === {esql} async query stop API | ||
| ++++ | ||
| <titleabbrev>{esql} async query stop API</titleabbrev> | ||
| ++++ | ||
|
|
||
| .New API reference | ||
| [sidebar] | ||
| -- | ||
| For the most up-to-date API details, refer to {api-es}/group/endpoint-esql[ES|QL APIs]. | ||
| -- | ||
|
|
||
| The <<esql,{esql}>> async query stop API is used to manually stop an async query. Once the stop command is issued, | ||
| the query stops processing new data and returns the results that have been already processed. Note that due to the pipelined | ||
| nature of {esql} queries, the stop operation is not immediate and may take time to return results. | ||
|
|
||
| The results are returned in <<esql-query-api-response-body,the same format>> as for | ||
| <<esql-async-query-get-api,{esql} async query get API>>. | ||
smalyshev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| If the query has been finished by the time the stop command is issued, the results are returned immediately. | ||
|
|
||
| If the query processing has not finished by the time the stop command is issued, the response will have | ||
| `is_partial` field set to `true`. | ||
smalyshev marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [source,console] | ||
| ---- | ||
| POST /query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=/stop | ||
| ---- | ||
| // TEST[skip: no access to query ID] | ||
|
|
||
| [[esql-async-query-stop-api-request]] | ||
| ==== {api-request-title} | ||
|
|
||
| `POST /_query/async/<query_id>/stop` | ||
|
|
||
| [[esql-async-query-stop-api-prereqs]] | ||
| ==== {api-prereq-title} | ||
|
|
||
| * If the {es} {security-features} are enabled, only the authenticated user that submitted the original query request | ||
| can stop the query. | ||
|
|
||
| [[esql-async-query-stop-api-path-params]] | ||
| ==== {api-path-parms-title} | ||
|
|
||
| `<query_id>`:: | ||
| (Required, string) | ||
| Identifier for the query to stop. | ||
| + | ||
| A query ID is provided in the <<esql-async-query-api,{esql} async query API>>'s | ||
| response for a query that does not complete in the awaited time. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
rest-api-spec/src/main/resources/rest-api-spec/api/esql.async_query_stop.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "esql.async_query_stop": { | ||
| "documentation": { | ||
| "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/esql-async-query-stop-api.html", | ||
| "description": "Stops a previously submitted async query request given its ID and collects the results." | ||
| }, | ||
| "stability": "stable", | ||
| "visibility": "public", | ||
| "headers": { | ||
| "accept": [ | ||
| "application/json" | ||
| ] | ||
| }, | ||
| "url": { | ||
| "paths": [ | ||
| { | ||
| "path": "/_query/async/{id}/stop", | ||
| "methods": [ | ||
| "POST" | ||
| ], | ||
| "parts": { | ||
| "id": { | ||
| "type": "string", | ||
| "description": "The async query ID" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.