[BUG] SQL returns HTTP 200 with silently partial results when a PIT hits search.max_open_pit_context
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by tracing OpenSearchRequestBuilder.createPit and the SQL response path, then compare how #5807 reports partial results in PPL. Check the existing tests for PIT creation and SQL responses. Done means a PIT that omits shards causes SQL to fail clearly or report partial results, with a regression test covering the reproducer.
索引モデルが issue の本文から書いたものです。
説明
What is the bug?
When a SQL query opens a point-in-time (PIT) over more shards than search.max_open_pit_context allows, SQL returns HTTP 200 with only some of the rows and no warning.
How can one reproduce the bug?
Steps to reproduce the behavior:
- Lower the PIT cap (default 300, dynamic) so this fits on one laptop, and turn index pruning off.
curl -s -X PUT localhost:9200/_cluster/settings -H 'Content-Type: application/json' \
-d '{"transient":{"search.max_open_pit_context":5,"plugins.query.pruning.enabled":false}}' | jq .acknowledged
# true
- Create 10 single-shard indices with one doc each.
for i in $(seq -w 1 10); do
curl -s -X PUT localhost:9200/pitdemo_$i -H 'Content-Type: application/json' \
-d '{"settings":{"number_of_shards":1,"number_of_replicas":0},"mappings":{"properties":{"day":{"type":"integer"}}}}' >/dev/null
curl -s -X POST localhost:9200/pitdemo_$i/_doc -H 'Content-Type: application/json' -d "{\"day\":$((10#$i))}" >/dev/null
done
curl -s -X POST 'localhost:9200/pitdemo_*/_refresh' >/dev/null
curl -s 'localhost:9200/pitdemo_*/_count' | jq .count
# 10
- Run a SQL row query over the pattern. Half the rows are gone, with status 200 and no warning.
curl -s -X POST localhost:9200/_plugins/_sql -H 'Content-Type: application/json' \
-d '{"query":"SELECT day FROM pitdemo_* ORDER BY day"}' | jq -c '{status, total, datarows, warnings}'
# {"status":200,"total":5,"datarows":[[1],[2],[3],[4],[5]],"warnings":null}
- Run the same query in PPL. It returns all 10 rows.
curl -s -X POST localhost:9200/_plugins/_ppl -H 'Content-Type: application/json' \
-d '{"query":"source=pitdemo_* | sort day | fields day"}' | jq .total
# 10
What is the expected behavior?
SQL returns all 10 rows. If the PIT can't cover every shard, SQL should fail the query or return the same partial-results warning PPL does, not return a short answer with HTTP 200.
What is your host/environment?
- mainline (3.10.0-SNAPSHOT), single node
Do you have any screenshots?
N/A
Do you have any additional context?
OpenSearchRequestBuilder.createPitpassesallowPartialPitCreation=true. Shards past the cap are left out of the PIT, so the search that follows sees_shards.failed: 0, and nothing appears in the response or the node log. With the cap back at 300, the same query returns 10 rows.- SQL uses a PIT here even without
fetch_size(_explainshows apitId). - At default settings it takes more than 300 shards in one query, e.g. ~750 daily single-shard indices with pruning off, which is where this was first seen.
- #5807 added a partial-results warning for PPL only. It skips the V2 fallback, and SQL responses have no
warningsfield, so SQL shard failures are silent too (not reproduced here). #5687 was the PPL version of this bug. #5808 is the same symptom from pruning dropping an index. - Possible fix: pass the PIT's missing-shard count into the SQL response as a warning, or create the PIT with
allowPartialPitCreation=falseand fail with a clear error.
- 主要言語
- Java
- スター
- 176
- フォーク
- 237
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 34
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensearch-project/sql のほかの issue
-
bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensearch-project/sql#5990 ·
メンテナーはふだん 1 日以内に返信
-
bug untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
opensearch-project/sql#5983 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] PromQL queries fail with InvalidTypeIdException when metric has a label named "type"対応中かも @nagendramohan が 107 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
opensearch-project/sql#5684 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
[DOC] Calcite settings documentation missing examples対応中かも @AzazelSensei が 64 日前に担当しました。 オープンdocumentation PPL
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/sql#4806 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
calcite enhancement Meta performance PPL untriaged
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
opensearch-project/sql#5991 ·
メンテナーはふだん 1 日以内に返信
opensearch-project/sql の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
PCL-Community/PCL-CE#3907 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 2 日以内に返信
-
area/dependencies area/dependencies/quarkus backport/26.6 backport/26.8 kind/cve severity/critical source/scan-dependencies status/triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
docker-to-squash.py: check_dependencies should find mksquashfs on PATH対応中かも @linzch3 が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
chore
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
lugassawan/swe-workbench#841 ·