Conversation
Signed-off-by: Peng Huo <penghuo@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This stacked PR adds the public API for PPL asynchronous queries. Review it against
feat/asyncquery-core, which is the source branch ofopensearch-project/sql#5809.The existing synchronous
POST /_plugins/_pplbehavior remains unchanged. Supplyingwait_for_completion_timeoutorkeep_aliveselects asynchronous execution:POST /_plugins/_pplsubmits and waits for direct completion.GET /_plugins/_ppl/jobs/{id}returns the complete current snapshot and optionally renews the lease.DELETE /_plugins/_ppl/jobs/{id}cancels or removes the retained job.Responses expose only
id,status,schema,datarows,total,took, anderrorwhere applicable. This PR does not expose progress, partial results, paging, or delta delivery.sequenceDiagram participant C as Client participant R as REST/Transport participant S as PPLAsyncQueryService participant E as AsyncQueryExecution C->>R: POST(query, wait, keep_alive) R->>S: start(...) S->>E: execute alt result before wait timeout E-->>S: completion S-->>R: SUCCEEDED, no ID R-->>C: final schema and rows else wait timeout before result S-->>R: RUNNING with opaque ID R-->>C: job ID C->>R: GET /jobs/{id} through any node R->>R: route to owner and preserve security context R->>S: authorize and get snapshot S-->>C: RUNNING, SUCCEEDED, or FAILED endSubmit, GET, and DELETE use independent transport permissions. Every GET and DELETE is routed to the owner node and reauthorizes the current caller against the retained owner identity. Owner loss and unknown, expired, or unauthorized jobs do not expose retained metadata or results.
The response formatter consumes the sealed
JobSnapshotcontract introduced by the core PR. Result materialization runs on the SQL worker pool; lifecycle transitions remain outside that work.Validation
Targeted ITs were run with
-DignorePrometheus; Full IT was not run.Related Issues
opensearch-project/sql#5796.opensearch-project/sql#5765.opensearch-project/sql#5809.opensearch-project/sql#5804.Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.