[BUG][PPL] Handle cancellation during Calcite-to-V2 fallback for sync and async queries
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
調査の方向性
Start by tracing the shared QueryService execution path used by synchronous PPL and async PPLQueryRunner, then inspect QueryJob and native PPL task cancellation. Add deterministic concurrency tests for both cancellation-versus-fallback orderings and the listed cancellation scenarios, with fallback enabled. Done means cancellation prevents fallback when it wins admission, admitted fallback stops and cleans up when cancellation follows, and sync/async integration tests verify observable attempts, worker drain, and PIT cleanup.
索引モデルが issue の本文から書いたものです。
説明
Problem
Synchronous PPL and async PPL execution share QueryService and its Calcite-to-V2 fallback decision. When cancellation races with an execution failure, the fallback path can treat that failure as an ordinary error and start V2 execution after cancellation was requested.
Recognizing CancellationException, TaskCancelledException, or wrapped/suppressed InterruptedException is only an exception-based safeguard. Cancellation state can be true while the exception contains no cancellation marker. There is also a race between checking a flag and starting fallback.
This issue tracks cancellation/fallback handling separately from the async DELETE work in #5846. It covers both synchronous and asynchronous PPL, rather than relying on async-only QueryJob state. Related: #5765 and production hardening in #5801.
Relevant behavior and evidence
- Normal synchronous PPL requests and async
PPLQueryRunnerrequests both reach the sameQueryServiceexecution path. QueryJobowns async lifecycle status. Synchronous queries have noQueryJob; native PPL task cancellation must also participate.- Async DELETE removes the job from the store before cancelling it, so executing queries cannot depend on a later job-store lookup.
- Unit-level regression scenarios reproduced V2 invocation after interrupted PIT waiting and after cancellation was suppressed during resource cleanup when
plugins.calcite.fallback.allowed=true. These are unit-level reproductions, not a claimed end-to-end production incident. - Existing async cancellation ITs verify cancellation acknowledgment, worker drain, bounded search activity, and PIT cleanup. They do not directly observe V2 fallback attempts or force the cancellation/fallback race; fallback is disabled by default.
Proposed direction
Use an explicit control allocated per PPL execution/task, shared with the async job when one exists. Keep OpenSearch task types out of the core-facing contract. Publish cancellation before callbacks and before exposing the relevant cancellation state, and atomically coordinate that publication with fallback admission. Propagate the same control across worker handoffs.
The implementation should define two orderings:
- Cancellation wins before fallback admission: V2 fallback must not start.
- Fallback was admitted first: cancellation must reach that execution, with bounded stop and cleanup behavior. Admission alone does not guarantee that already-running work stops.
Exception recognition may remain a secondary safeguard; it must not be the sole cancellation authority. Preserve timeout failure semantics and ordinary uncancelled fallback behavior. The final design need not use the proposed API shape if another explicit-state solution meets these guarantees.
Acceptance criteria
- Cover synchronous PPL task cancellation and async PPL DELETE, including owner forwarding.
- A cancelled execution followed by an ordinary error with no cancellation cause cannot be admitted to V2 fallback.
- Define and test cancellation-versus-fallback admission ordering with deterministic concurrency tests.
- Define and verify stopping and cleanup when fallback was admitted before cancellation.
- Cancellation remains observable after async job removal and across worker/thread handoffs; signals do not leak between queries on reused workers.
- Preserve terminal-state races, timeout failure semantics, and successful unsupported-query fallback when no cancellation is requested.
- Add UTs with fallback enabled for plain errors, interrupted PIT waiting, suppressed cleanup cancellation, and both race orderings.
- Add sync and async ITs with fallback explicitly enabled and restored, and observable fallback attempts. Verify worker drain and PIT/search-context cleanup.
Scope decision for #5846
At the author's request, cancellation/fallback policy changes and their dedicated regression tests are deferred to this issue. Regular async cancellation, deletion, routing, authorization, retention cleanup, and their lifecycle ITs remain in #5846.
- 主要言語
- Java
- スター
- 175
- フォーク
- 236
- 平均マージ
- 2日 19時間
- マージ済み PR(30日)
- 40
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensearch-project/sql のほかの issue
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"対応中かも @nagendramohan が 88 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
opensearch-project/sql#5684 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[DOC] Calcite settings documentation missing examples対応中かも @AzazelSensei が 45 日前に担当しました。 オープンdocumentation PPL
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/sql#4806 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
opensearch-project/sql#5928 ·
メンテナーはふだん 1 日以内に返信
-
[Testing] Test downstream plugins that load SQL classes (alerting, skills)対応中かも @ahkcs が 4 日前に担当しました。 オープンinfrastructure testing
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
opensearch-project/sql#5925 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Analytics routing does not resolve aliases and wildcard index expressions対応中かも @KarstenSchnitter が 9 日前に担当しました。 オープンanalytic-engine bug
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
opensearch-project/sql#5916 ·
メンテナーはふだん 1 日以内に返信
opensearch-project/sql の issue をすべて見る
似ている issue
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 90/100
-
bug subsystem:agent-harness triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
NationalSecurityAgency/ghidra#10155 ·
メンテナーはふだん 2 日以内に返信
-
area:data coverage
難易度 1/5 1時間未満 初心者へのやさしさ 67/100
reacher-z/Awesome-CUA#4864 ·
メンテナーはふだん 19 日以内に返信
-
bug web-ui
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
jenkinsci/jenkins#27705 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信