Skip to content

docs: async-query lifecycle follow-up design - #15

Closed
penghuo wants to merge 1 commit into
mainfrom
design/async-query-lifecycle
Closed

penghuo wants to merge 1 commit into
mainfrom
design/async-query-lifecycle

Conversation

@penghuo

@penghuo penghuo commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Design doc for the follow-up PR after opensearch-project#5818 (the neutral QueryJobService lifecycle).

Answers three questions raised in review:

  1. How does routing work? Details in §4.1 and sequence diagrams §7.5–§7.6. No new REST endpoints, no new transport ActionTypes. The router is a single new class (RoutingAsyncQueryExecutorService) that sits behind the existing AsyncQueryExecutorService interface and dispatches on the id shape. TransportGetAsyncQueryResultAction and TransportCancelAsyncQueryRequestAction are unchanged.

  2. How to switch sync/async without a body parameter? §4.2 — URL parameter wait_for_completion_timeout (Elasticsearch async-search / BigQuery pattern). Sync behavior stays the default for old clients that don't send the parameter. ?async=true is not needed as a separate flag — it's equivalent to ?wait_for_completion_timeout=0.

  3. What is a terminal state? §4.3 + §5. SUCCEEDED / FAILED / CANCELLED. Retention is orthogonal (a service-layer RetentionPolicy, not part of state).

Doc: docs/dev/async-query-lifecycle-design.md.

Design-only; no code changes. Awaiting sign-off on §10 open questions before implementation.

…outing

Design doc for the async-query REST wiring on top of the QueryJobService
landed in opensearch-project#5818. Answers three specific questions:

  1. How does routing between the existing Spark path and the new
     QueryJobService path work? What new transport actions are needed?
     -> None. Routing lives inside AsyncQueryExecutorService via a new
        RoutingAsyncQueryExecutorService that inspects the queryId. Zero
        new REST endpoints, zero new ActionTypes.

  2. How do we switch between sync and async without adding a request-body
     parameter?
     -> URL parameter wait_for_completion_timeout (Elasticsearch async-
        search / BigQuery pattern). Absent = wait forever = current sync
        behavior. 0 = pure async. Positive = hybrid.

  3. What is a terminal state?
     -> SUCCEEDED, FAILED, CANCELLED. State does not change after entering
        one; completedAtMillis, result, and failure invariants are
        enforced by the record. Retention is orthogonal — modelled as a
        service-layer RetentionPolicy, not a state.

Design-only; no code changes.

Signed-off-by: Peng Huo <[email protected]>
@penghuo
penghuo requested a review from dai-chen as a code owner September 28, 2026 22:15
@penghuo penghuo closed this Sep 28, 2026
@penghuo
penghuo deleted the design/async-query-lifecycle branch September 28, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant