# Data node client node interaction

**URL:** <https://discuss.elastic.co/t/data-node-client-node-interaction/80130>\
**Category:** Elasticsearch\
**Created:** [March 27, 2017, 12:26pm UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130 "2017-03-27T12:26:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utkarsh\_Pyne](https://avatars.discourse-cdn.com/v4/letter/u/a587f6/32.png) [@Utkarsh\_Pyne](https://discuss.elastic.co/u/Utkarsh_Pyne)\
**Post date:** [March 27, 2017, 12:26pm UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/1 "2017-03-27T12:26:22Z")

</div>

We use separate data and client nodes in our cluster, all reads go through the client nodes. So client nodes act as co-ordinating nodes in our case. Now for this given setup I have couple of questions in my mind,

- What happens to the requests in the search queue of the data nodes if the client node that had forwarded those requests goes out of the cluster due to OOM ?

- In the second case, what happens if the data node that had the request forwarded from a client node goes OOM.

I'm assuming an environment where there are multiple shards, with two replicas.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 30, 2017, 7:08am UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/2 "2017-03-30T07:08:35Z")

</div>

> [@Utkarsh\_Pyne](#):
>
> Will some other client node take the place of the client node that went OOM and do the merge.

No, queries are stateful only on the originating node.  
An educated guess would be that the queries are just discarded after they have run and the client will need to query again.

I'll see if I can get an official answer though, cause it's hard to know everything ES does 🙂

---

<div class="post-metadata">

**Author:** ![Utkarsh\_Pyne](https://avatars.discourse-cdn.com/v4/letter/u/a587f6/32.png) [@Utkarsh\_Pyne](https://discuss.elastic.co/u/Utkarsh_Pyne)\
**Post date:** [March 30, 2017, 9:29am UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/3 "2017-03-30T09:29:39Z")

</div>

Thanks @warkolm for your answer, I'm eagerly looking forward to get an official answer.

Meanwhile, just to clarify few things about that "state-fulness" of the queries I had few questions,

- Since state is only maintained on the originating node, so if this node itself goes OOM the computation done by the data nodes will be a waste as there is no node to gather the responses sent by these data nodes, right ?

- Since data nodes are not aware of any state of the query, they will execute all the queries in their search queue even if the node that had initiated that query is no more part of the cluster ?

- If the originating node maintains the state of the queries then if a data node goes OOM (which was executing a query/had a query in it's queue scattered by the originating node) then the originating node won't get the result back from this data node. In this case will originating node retry it with some other data node or wait for the data node gone OOM to join back and again resend the request ?

---

<div class="post-metadata">

**Author:** ![Utkarsh\_Pyne](https://avatars.discourse-cdn.com/v4/letter/u/a587f6/32.png) [@Utkarsh\_Pyne](https://discuss.elastic.co/u/Utkarsh_Pyne)\
**Post date:** [April 15, 2017, 12:59pm UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/4 "2017-04-15T12:59:24Z")

</div>

> [@warkolm](#):
>
> I'll see if I can get an official answer though, cause it's hard to know everything ES does 🙂

Did you get a chance to check on this one ?

---

<div class="post-metadata">

**Author:** ![abeyad](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abeyad](https://discuss.elastic.co/u/abeyad)\
**Post date:** [April 17, 2017, 2:43pm UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/5 "2017-04-17T14:43:20Z")

</div>

> [@warkolm](#):
>
> An educated guess would be that the queries are just discarded after they have run and the client will need to query again.

This is correct.

> [@Utkarsh\_Pyne](#):
>
> Will the client node detect that the data node is not responding and send the request to some other data node having a replica of this shard ?

Yes, the coordinating node will try sending the request to other copies of the shard until all shard copies are exhausted without successfully getting a response to the search request. Even in that case, partial results will be returned from all the shards that successfully returned a response to the query.

---

<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:** [May 15, 2017, 2:45pm UTC](https://discuss.elastic.co/t/data-node-client-node-interaction/80130/6 "2017-05-15T14:45:38Z")

</div>

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