From 9a5276807e4411b3307e73f0354f10ee89936258 Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Fri, 11 Feb 2022 14:39:18 -0800 Subject: [PATCH] Document that awareness attributes override custom preferences (#83818) When selecting replicas in a search, the coordinating node prefers nodes with the same shard allocation awareness attributes. If the search contains a custom preference string, then it will be ignored in favor of selecting a node with the same attributes. In 8.0, allocation awareness attributes no longer influence search replica selection. So although this is a bug, we do not intend to fix it in 7.x or 6.x. Instead, we document the behavior as a 'warning' and mention a system property that can be used to disable the behavior. --- .../search/search-your-data/search-shard-routing.asciidoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/reference/search/search-your-data/search-shard-routing.asciidoc b/docs/reference/search/search-your-data/search-shard-routing.asciidoc index b0286986df7fe..47df3e1dfcaae 100644 --- a/docs/reference/search/search-your-data/search-shard-routing.asciidoc +++ b/docs/reference/search/search-your-data/search-shard-routing.asciidoc @@ -88,6 +88,14 @@ GET /my-index-000001/_search?preference=my-custom-shard-string ---- // TEST[setup:my_index] +WARNING: If a node has <> +attributes, then it will prefer shards with the same awareness attribute values. +Because of these attributes, different coordinating nodes may route the same +search differently, even if the searches use the same custom `preference` +values. To disable routing based on awareness attributes, set the +`es.search.ignore_awareness_attributes` system property to `true` in the +<> of every node in the cluster. + NOTE: If the cluster state or selected shards change, the same `preference` string may not route searches to the same shards in the same order. This can occur for a number of reasons, including shard relocations and shard failures. A