elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.51k stars 24.6k forks source link

`action.search.shard_count.limit` should apply to the shard count post `can_match` phase #52524

Open jpountz opened 4 years ago

jpountz commented 4 years ago

action.search.shard_count.limit was initially introduced as a soft limit that prevented queries to hit too many shards. In 6.x we introduced the can_match phase that pre-filters non-matching shards and we decided to set this soft limit to unlimited by default.

Unfortunately this broke some users who were relying on this setting as a way to prevent their users from killing their clusters, e.g. by sending requests that don't have a time range.

I'd suggest to keep the default value of action.search.shard_count.limit to unlimited, but change the semantics of this setting to apply to the number of shards after the can_match request so that they could still protect their clusters against users who run queries without a time range.

Related discussion #35917

elasticmachine commented 4 years ago

Pinging @elastic/es-search (:Search/Search)

jpountz commented 4 years ago

We discussed this issue today and our general feeling is that this setting should no longer be needed, but we don't want to move forward with the removal without making sure we're not missing anything. Specifically, we're thinking of two use-cases for this setting:

Are we missing something?

elasticsearchmachine commented 1 year ago

Pinging @elastic/es-search (Team:Search)

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-search-foundations (Team:Search Foundations)