[BUG] searchShards fails on Managed OpenSearch servers that omit node metadata
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
OpenSearchClient.searchShards と SearchShardsResponse._DESERIALIZER から始め、次に NodeAttributes を定義する canonical schema と bundled schema を調べます。2 つのメタデータフィールドを optional にした後、Java モデルを再生成し、データが設定された shards、完全なメタデータ、round trip、および共有の _shard_stores schema を含む回帰ケースを Jackson と JSON-B で実行します。省略されたフィールドが提案された空の map と null としてデシリアライズされ、指定されたメタデータが保持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What is the bug?
OpenSearchClient.searchShards(...) rejects an HTTP 200 response when a node omits attributes and transport_address. Applications that only need shard routing information cannot access the typed response, even when the index and shard data are present. This shape was reported from an Amazon OpenSearch Service 1.3.x domain:
{"nodes":{"node-id":{"name":"node-name","ephemeral_id":"ephemeral-id"}},"indices":{},"shards":[]}
The example is redacted and minimized; the reported response also contained index and shard data.
Reproduction
Reproduced with the published 3.9.0 and 3.10.0 clients using Jackson and JSON-B, and through the public method with a local HTTP 200 fixture server. The required fields are also unchanged on current main (1abf420c).
String json = "{\"nodes\":{\"node-id\":{\"name\":\"node-name\","
+ "\"ephemeral_id\":\"ephemeral-id\"}},\"indices\":{},\"shards\":[]}";
var mapper = new org.opensearch.client.json.jackson.JacksonJsonpMapper();
try (var parser = mapper.jsonProvider().createParser(new java.io.StringReader(json))) {
org.opensearch.client.opensearch.core.SearchShardsResponse._DESERIALIZER
.deserialize(parser, mapper);
}
This throws Missing required property 'NodeAttributes.attributes'. Adding "attributes":{} then throws Missing required property 'NodeAttributes.transportAddress', so both omissions need handling.
Expected behavior and proposed fix
Could the response model tolerate these two omitted metadata fields so applications can still consume the shard routing information? The proposed behavior is an empty map from node.attributes() and null from node.transportAddress(), preserving metadata when supplied. name and ephemeral_id would remain required.
Stock server serializers in 1.3.0, 1.3.20, 2.19.6, 3.0.0, and 3.8.0 emit both fields, and the current client follows that contract. This request is for client compatibility with the reported managed response. Newer managed domains have not been tested here. A related omission in task responses was handled by making node fields optional in #463, fixing #356.
The local candidate removes both requirements from the canonical and bundled schemas and regenerates the Java model. All 14 regression cases pass across Jackson and JSON-B, including populated shards, complete metadata, and round trips. The schema is also shared with _shard_stores, which is covered by the tests. I can submit linked specification and client PRs if this approach is suitable; guidance on endpoint-specific or distribution-specific treatment would also be welcome.
Thanks!
- 主要言語
- Java
- スター
- 165
- フォーク
- 256
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 37
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opensearch-project/opensearch-java のほかの issue
-
enhancement untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
opensearch-project/opensearch-java#2188 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] "shape" should not be required in GeoShapeQueryField再び着手できるかも @lsh1215 が 120 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/opensearch-java#2011 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
opensearch-project/opensearch-java#2008 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] ISM types lastUpdatedTime is susceptible to int overflow対応中かも @gingeekrishna が 116 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
opensearch-project/opensearch-java#1898 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement untriaged
難易度 4/5 3〜5日 初心者へのやさしさ 64/100
opensearch-project/opensearch-java#2195 ·
メンテナーはふだん 1 日以内に返信
opensearch-project/opensearch-java の issue をすべて見る
似ている issue
-
priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/java-genai#1372 ·
メンテナーはふだん 1 日以内に返信
-
GeoSeries scale and skew tests fail with pytest 9.2.0対応中かも @jiayuasu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
carlos-emr/carlos#5431 ·
メンテナーはふだん 1 日以内に返信
-
Integration tests: jetty:run fails with WELD-001408 for CountryJpaService対応中かも @viniciusmachak が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
primefaces/primefaces#15431 ·
メンテナーはふだん 1 日以内に返信
-
test(multi-tenancy): assert cross-tenant vulnerability reads are refused in the CWE isolation testオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
OpenAEV-Platform/openaev#8792 ·
メンテナーはふだん 2 日以内に返信