Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert the stability of custom search preferences #41150

Conversation

DaveCTurner
Copy link
Contributor

Today the ?preference=custom_string_value search preference will only change
its choice of a shard copy if something changes the IndexShardRoutingTable
for that specific shard. Users can use this behaviour to route searches to a
consistent set of shard copies, which means they can reliably hit copies with
hot caches, and use the other copies only for redundancy in case of failure.
However we do not assert this property anywhere, so we might break it in
future.

This commit adds a test that shows that searches are routed consistently even
if other indices are created/rebalanced/deleted.

Relates https://discuss.elastic.co/t/176598, #41115, #26791

Today the `?preference=custom_string_value` search preference will only change
its choice of a shard copy if something changes the `IndexShardRoutingTable`
for that specific shard. Users can use this behaviour to route searches to a
consistent set of shard copies, which means they can reliably hit copies with
hot caches, and use the other copies only for redundancy in case of failure.
However we do not assert this property anywhere, so we might break it in
future.

This commit adds a test that shows that searches are routed consistently even
if other indices are created/rebalanced/deleted.

Relates https://discuss.elastic.co/t/176598, elastic#41115, elastic#26791
@DaveCTurner DaveCTurner added >non-issue :Search/Search Search-related issues that do not fall into other categories team-discuss v8.0.0 v7.2.0 labels Apr 12, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@DaveCTurner
Copy link
Contributor Author

Marking this as >team-discuss because it's not clear to me whether this property is by design or is an accident, and I think we should make a deliberate decision about that first.

@DaveCTurner
Copy link
Contributor Author

We discussed this and agreed to add this test to make sure that we do not unconsciously change this behaviour in future, but to leave the docs as they are since we cannot really guarantee that any given IndexShardRoutingTable will remain stable.

@DaveCTurner DaveCTurner merged commit 48fea49 into elastic:master Apr 17, 2019
@DaveCTurner DaveCTurner deleted the 2019-04-12-validate-custom-search-preference-stability branch April 17, 2019 15:36
DaveCTurner added a commit that referenced this pull request Apr 17, 2019
Today the `?preference=custom_string_value` search preference will only change
its choice of a shard copy if something changes the `IndexShardRoutingTable`
for that specific shard. Users can use this behaviour to route searches to a
consistent set of shard copies, which means they can reliably hit copies with
hot caches, and use the other copies only for redundancy in case of failure.
However we do not assert this property anywhere, so we might break it in
future.

This commit adds a test that shows that searches are routed consistently even
if other indices are created/rebalanced/deleted.

Relates https://discuss.elastic.co/t/176598, #41115, #26791
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
Today the `?preference=custom_string_value` search preference will only change
its choice of a shard copy if something changes the `IndexShardRoutingTable`
for that specific shard. Users can use this behaviour to route searches to a
consistent set of shard copies, which means they can reliably hit copies with
hot caches, and use the other copies only for redundancy in case of failure.
However we do not assert this property anywhere, so we might break it in
future.

This commit adds a test that shows that searches are routed consistently even
if other indices are created/rebalanced/deleted.

Relates https://discuss.elastic.co/t/176598, elastic#41115, elastic#26791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants