Skip to content

Commit 7ef5105

Browse files
committed
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.
1 parent 081dd64 commit 7ef5105

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/reference/search/search-your-data/search-shard-routing.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ GET /my-index-000001/_search?preference=my-custom-shard-string
8888
----
8989
// TEST[setup:my_index]
9090

91+
WARNING: If a node has <<shard-allocation-awareness,shard allocation awareness>>
92+
attributes, then it will prefer shards with the same awareness attribute values.
93+
Because of these attributes, different coordinating nodes may route the same
94+
search differently, even if the searches use the same custom `preference`
95+
values. To disable routing based on awareness attributes, set the
96+
`es.search.ignore_awareness_attributes` system property to `true` in the
97+
<<set-jvm-options,JVM options>> of every node in the cluster.
98+
9199
NOTE: If the cluster state or selected shards change, the same `preference`
92100
string may not route searches to the same shards in the same order. This can
93101
occur for a number of reasons, including shard relocations and shard failures. A

0 commit comments

Comments
 (0)