Skip to content

Commit

Permalink
Document that awareness attributes override custom preferences (#83818)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jtibshirani authored Feb 11, 2022
1 parent f008006 commit 9a52768
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ GET /my-index-000001/_search?preference=my-custom-shard-string
----
// TEST[setup:my_index]

WARNING: If a node has <<shard-allocation-awareness,shard allocation awareness>>
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
<<set-jvm-options,JVM options>> 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
Expand Down

0 comments on commit 9a52768

Please sign in to comment.