Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] searchShards fails on Managed OpenSearch servers that omit node metadata

オープン
#2,145 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java
領域
api, databases

調査の方向性

OpenSearchClient.searchShards と SearchShardsResponse._DESERIALIZER から始め、次に NodeAttributes を定義する canonical schema と bundled schema を調べます。2 つのメタデータフィールドを optional にした後、Java モデルを再生成し、データが設定された shards、完全なメタデータ、round trip、および共有の _shard_stores schema を含む回帰ケースを Jackson と JSON-B で実行します。省略されたフィールドが提案された空の map と null としてデシリアライズされ、指定されたメタデータが保持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug untriaged
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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opensearch-project/opensearch-java のほかの issue

opensearch-project/opensearch-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。