# Preventing SearchPhaseExecutionExceptions during rolling restart of cluster nodes

**URL:** <https://discuss.elastic.co/t/preventing-searchphaseexecutionexceptions-during-rolling-restart-of-cluster-nodes/265182>\
**Category:** Elasticsearch\
**Created:** [February 23, 2021, 9:21am UTC](https://discuss.elastic.co/t/preventing-searchphaseexecutionexceptions-during-rolling-restart-of-cluster-nodes/265182 "2021-02-23T09:21:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amishar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amishar/32/76363_2.png) [@amishar](https://discuss.elastic.co/u/amishar)\
**Post date:** [February 23, 2021, 9:21am UTC](https://discuss.elastic.co/t/preventing-searchphaseexecutionexceptions-during-rolling-restart-of-cluster-nodes/265182/1 "2021-02-23T09:21:02Z")

</div>

Several Scroll Search requests fail with SearchPhaseExecutionException around the time when there is a rolling restart of the nodes in the cluster(ES 6.8). These SearchPhaseExecution exception has an underlying cause that points to disconnect between the nodes within cluster(due to rolling restart). The root cause varies from IllegalStateException("node xxx not available"[1]), NodeNotConnectedException, NodeDisconnectedException.

I would expect the transport client to automatically retry another node while the current node is down. My understanding is that these exception are not retried because they are occurring in the fetch phase and only option is for client to retry the search query. Is this correct? What is the recommended way to handle these exception?

[1][elasticsearch/SearchScrollAsyncAction.java at 6.8 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/6.8/server/src/main/java/org/elasticsearch/action/search/SearchScrollAsyncAction.java#L154)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 23, 2021, 12:06pm UTC](https://discuss.elastic.co/t/preventing-searchphaseexecutionexceptions-during-rolling-restart-of-cluster-nodes/265182/2 "2021-02-23T12:06:18Z")

</div>

> [@amishar](#):
>
> My understanding is that these exception are not retried because they are occurring in the fetch phase and only option is for client to retry the search query. Is this correct?

That sounds correct, yes.

> [@amishar](#):
>
> What is the recommended way to handle these exception?

I think you will need to try again yourself. The client will not retry automatically.

---

<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:** [March 23, 2021, 12:06pm UTC](https://discuss.elastic.co/t/preventing-searchphaseexecutionexceptions-during-rolling-restart-of-cluster-nodes/265182/3 "2021-03-23T12:06:21Z")

</div>

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