When using the search preference _primary, and executing a search on a cluster where a concerned primary is about to complete relocation, it's possible that the search for that primary will fail, as it will hit the primary relocation source just when the relocation is completed and the source shard is shut down. My question is:
Should the search preference _primary take the primary relocation target into account?
Put differently, should OperationRouting.preferenceActiveShardIterator(...) return the primary relocation target as backup when specifying _primary preference?
Note that the default search preference always takes relocation targets into account (and puts them last together with the "regular" initializing shards).
Related question:
Should the search preference _replica also take replica relocation targets into account?
More background to this:
There was a test failure of SearchWhileCreatingIndexIT which illustrates the issue:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+g1gc/4012/consoleFull
When using the search preference
_primary, and executing a search on a cluster where a concerned primary is about to complete relocation, it's possible that the search for that primary will fail, as it will hit the primary relocation source just when the relocation is completed and the source shard is shut down. My question is:Should the search preference
_primarytake the primary relocation target into account?Put differently, should
OperationRouting.preferenceActiveShardIterator(...)return the primary relocation target as backup when specifying_primarypreference?Note that the default search preference always takes relocation targets into account (and puts them last together with the "regular" initializing shards).
Related question:
Should the search preference
_replicaalso take replica relocation targets into account?More background to this:
There was a test failure of SearchWhileCreatingIndexIT which illustrates the issue:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+g1gc/4012/consoleFull