# Querying elasticsearch during a rolling update

**URL:** <https://discuss.elastic.co/t/querying-elasticsearch-during-a-rolling-update/356152>\
**Category:** Elasticsearch\
**Created:** [March 26, 2024, 8:26am UTC](https://discuss.elastic.co/t/querying-elasticsearch-during-a-rolling-update/356152 "2024-03-26T08:26:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucy\_Johnson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lucy_johnson/32/127479_2.png) [@Lucy\_Johnson](https://discuss.elastic.co/u/Lucy_Johnson)\
**Post date:** [March 26, 2024, 8:26am UTC](https://discuss.elastic.co/t/querying-elasticsearch-during-a-rolling-update/356152/1 "2024-03-26T08:26:14Z")

</div>

Hello everyone. I'm not super sure if that's the best place to ask but I'm hoping to get further information from here.

My goal is to query my elasticsearch-cluster (v 7.17) with either the deprecated elastic client or the recommended one (Java) during a rolling update.

To enable that I'm using the helm chart from bitnami [charts/bitnami/elasticsearch at main · bitnami/charts · GitHub](https://github.com/bitnami/charts/tree/main/bitnami/elasticsearch) that abstracts all the rolling update mechanisms for Kubernetes away, so I don't have to do that myself as described in the rolling update tutorial ([Rolling upgrades | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/rolling-upgrades.html)).

I've passed my elastic-client the addresses to my coordinator nodes (coordinator-0 and coordinator-1). And tried to perform a rolling update while doing some simple queries in a test Java-App in a loop. Unfortunately I'm receiving an "UnknownHostException" error once the coordinator-0 shuts down. (That should be normal, since the bitnami chart uses the Kubernetes stateful set, that doesn't deliver a DNS lookup anymore once the node is down)

I would have expected the client to then try to perform the request on coordinator-1 next, but it exits with the mentioned Exception (for both Java Elastic-Clients) instead. One reason for that seems to be that the UnknownHostException is not a RetryableException as required to perform the Request on the next node:

> <https://github.com/elastic/elasticsearch/blob/main/client/rest/src/main/java/org/elasticsearch/client/RestClient.java#L306>

So I'm in a difficult position now, where I'm not sure how to proceed further. Should I implement my own retry-mechanism in the Application, or am I using the chart wrong in some way?

I hoped that my use case would be fairly common, so that I could just use the defaults of the bitnami chart. if you guys have some ideas I would be happy for any kind of advice.

Cheers

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 23, 2024, 8:26am UTC](https://discuss.elastic.co/t/querying-elasticsearch-during-a-rolling-update/356152/2 "2024-04-23T08:26:31Z")

</div>

Closed on April 23, 2024, 8:26am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
