[BUG] searchShards fails on Managed OpenSearch servers that omit node metadata
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Inizia da OpenSearchClient.searchShards e SearchShardsResponse._DESERIALIZER, quindi esamina gli schemi canonici e inclusi che definiscono NodeAttributes. Rigenera il modello Java dopo aver reso opzionali i due campi dei metadati ed esegui i casi di regressione con Jackson e JSON-B, inclusi shards popolati, metadati completi, round trip e lo schema condiviso _shard_stores. Il lavoro è completo quando i campi omessi vengono deserializzati come la mappa vuota proposta e null, mentre i metadati forniti rimangono preservati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- Java
- Stelle
- 165
- Fork
- 256
- Merge medio
- 19h 9m
- PR unite (30g)
- 42
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opensearch-project/opensearch-java
-
[BUG] jackson3 JacksonJsonpMapper(ObjectMapper) fails to deserialize `_source` with "Trailing token" errorForse già presa @junyeokk l’ha presa 1 giorno fa. Apertabug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
opensearch-project/opensearch-java#2236 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
opensearch-project/opensearch-java#2188 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] "shape" should not be required in GeoShapeQueryFieldForse di nuovo libera @lsh1215 l’ha presa 119 giorni fa e non c’è nessuna pull request aperta. Apertabug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opensearch-project/opensearch-java#2011 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
opensearch-project/opensearch-java#2008 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] ISM types lastUpdatedTime is susceptible to int overflowForse già presa @gingeekrishna l’ha presa 114 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
opensearch-project/opensearch-java#1898 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opensearch-project/opensearch-java
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
strimzi/strimzi-kafka-operator#13328 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OpenLiberty/ci.maven#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
Payer adjustment can exceed the balance left after copay and deductible, so claim payments add up to more than the chargeForse già presa @DG47 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
synthetichealth/synthea#1772 ·
I maintainer di solito rispondono entro 13 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
geonetwork/core-geonetwork#9592 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NationalSecurityAgency/ghidra#10040 ·
I maintainer di solito rispondono entro 2 giorni