# Wrong zone used for query?

**URL:** <https://discuss.elastic.co/t/wrong-zone-used-for-query/228642>\
**Category:** Elasticsearch\
**Created:** [April 18, 2020, 12:36pm UTC](https://discuss.elastic.co/t/wrong-zone-used-for-query/228642 "2020-04-18T12:36:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![klahnakoski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klahnakoski/32/3679_2.png) [@klahnakoski](https://discuss.elastic.co/u/klahnakoski)\
**Post date:** [April 18, 2020, 12:36pm UTC](https://discuss.elastic.co/t/wrong-zone-used-for-query/228642/1 "2020-04-18T12:36:07Z")

</div>

How do I ensure my queries are directed to nodes in the same zone?

My queries are running slow, and I just learned about `"profile": true,`. In the profile I could see the slow [node][index][shard] that was causing the problem. It turns out the node was in another zone under heavy ingestion load (and maybe query load too). I did not expect this.

My cluster has two zones `primary` and `spot`. The `primary` zone has 4 nodes, and all the shards and is under heavy load. The `spot` zone has 40 the nodes, with the same number of shards, so less shards per node. Finally, there is one coordinator node, in the `spot` zone, that accepts all query requests, and has no data. In theory the coordinator should be sending queries to the `spot` zone, not the `primary` zone.

All nodes have the awareness attribute set

```
cluster.routing.allocation.awareness.attributes: zone
cluster.routing.allocation.enable: none

```

and all nodes have `node.attr.zone` set to either `primary` or `spot` as per above.

I am wondering if `cluster.routing.allocation.enable: none` may be causing the problem: Since it shares a prefix, maybe `cluster.routing.allocation.awareness` is also turned off?

Thank you

---

<div class="post-metadata">

**Author:** ![klahnakoski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klahnakoski/32/3679_2.png) [@klahnakoski](https://discuss.elastic.co/u/klahnakoski)\
**Post date:** [April 18, 2020, 12:45pm UTC](https://discuss.elastic.co/t/wrong-zone-used-for-query/228642/2 "2020-04-18T12:45:03Z")

</div>

Of course I could not see the problem until I asked the question.

There is a daemon that was removing the `awareness.attributes`, and therefore disabling the query routing.

---

<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 16, 2020, 12:45pm UTC](https://discuss.elastic.co/t/wrong-zone-used-for-query/228642/3 "2020-05-16T12:45:06Z")

</div>

Closed on May 16, 2020, 12:45pm UTC

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