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

Add safeguards to prevent simple user errors #11511

Closed
16 of 24 tasks
clintongormley opened this issue Jun 5, 2015 · 24 comments
Closed
16 of 24 tasks

Add safeguards to prevent simple user errors #11511

clintongormley opened this issue Jun 5, 2015 · 24 comments
Labels
:Core/Infra/Core Core issues without another label :Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Meta :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.0.3

Comments

@clintongormley
Copy link
Contributor

clintongormley commented Jun 5, 2015

There are a number of places where a naive user can break Elasticsearch very easily. We should add more (dynamically overridable) safeguards that prevent users from hurting themselves.

Note:

  • We are adding high limits to start so that we don't suddenly disable things that users already do today, but so that sysadmins have tools that they can use to protect their clusters. We can revisit the limits later on.
  • All these settings should be prefixed by policy. to make them easier to document together and to understand their purpose.

Accepted limits:


For discussion:

Any other ideas?

@jpountz
Copy link
Contributor

jpountz commented Jun 5, 2015

Limit the max number of shards

I'm wondering if we should do it per index or per cluster. If we do it per index, then we might also want to have a max number of indices per cluster.

Limit the size of a bulk request

I guess it would also apply to multi-get and multi-search.

@alexbrasetvik
Copy link
Contributor

Some of this could go into a "sanity checker"-kind of plugin akin to the migration plugin that runs a bunch of tests as well.

That one could warn when e.g. minimum master nodes looks wrong, and when the number of shards/indexes/fields looks silly / approaches the above limits.

@clintongormley
Copy link
Contributor Author

@alexbrasetvik the requires the user to actually run the check. Often poor sysadmins are at the mercy of their users. What I'd like to do is to prevent users from blowing things up by mistake.

@alexbrasetvik
Copy link
Contributor

@clintongormley Agreed! I still think there's room for both, though such a tool should be another issue.

For example, a high number of indexes with few documents and identical mappings can be a sign that the user is doing per-user index partitioning when he shouldn't. That will turn into a problem, even if the current values are far from hitting above mentioned limits.

@pickypg
Copy link
Member

pickypg commented Jul 15, 2015

Any other ideas?

  • Limit the max number of indices
    • It's effectively covered by limiting by shards, but touching too many indices may indicate more of a logical issue than the shard count (e.g., with daily indices, it's much easier to realize that sending a request to 5 indices represents five days rather than 25 shards with default counts).
  • Limit the concurrent request size
    • Request circuit breaker across all concurrent requests

@dakrone
Copy link
Member

dakrone commented Jul 16, 2015

Limit the concurrent request size

This is already available with the thread pools and queue_sizes to limit the number of requests per-node and apply backpressure.

EDIT: I guess I am taking "size" as "count", is that what you mean?

@pickypg
Copy link
Member

pickypg commented Jul 17, 2015

@dakrone Size of an actual request. For instance, if one request comes in with an aggregation that uses size: 0 at the same time as another, then maybe we should block the second one (or at least delay).

@jpountz
Copy link
Contributor

jpountz commented Oct 30, 2015

Another protection to add: check mapping depth #14370

@ppf2
Copy link
Member

ppf2 commented Nov 2, 2015

Limit the max value that can be set for queue_size for our search, bulk, index, etc.. thread pools so users can't set them to unlimited, millions, etc..?

@s1monw
Copy link
Contributor

s1monw commented Mar 28, 2017

@clintongormley I think we missed one rather important aspect when it comes to soft-limits. Today the user can override those limits via dynamic properties which is ok most of the time but in the case of a cloud hosting infrastructure where the org that runs the infrastructure needs to have full control over these limits they should be able to disable the dynamic property or should disable setting these settings entirely?

@javanna javanna removed the discuss label May 5, 2017
jimczi added a commit to jimczi/elasticsearch that referenced this issue Aug 30, 2017
This change adds a dynamic cluster setting named `search.max_keep_alive`.
It is used as an upper limit for scroll expiry time in scroll queries and defaults to 1 hour.
This change also ensures that the existing setting `search.default_keep_alive` is always smaller than `search.max_keep_alive`.

Relates elastic#11511
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Sep 5, 2017
jimczi added a commit that referenced this issue Sep 6, 2017
This change adds a dynamic cluster setting named `search.max_keep_alive`.
It is used as an upper limit for scroll expiry time in scroll queries and defaults to 1 hour.
This change also ensures that the existing setting `search.default_keep_alive` is always smaller than `search.max_keep_alive`.

Relates #11511

* check style

* add skip for bwc

* iter

* Add a maxium throttle wait time of 1h for reindex

* review

* remove empty line
jimczi added a commit that referenced this issue Sep 7, 2017
This change adds a dynamic cluster setting named `search.max_keep_alive`.
It is used as an upper limit for scroll expiry time in scroll queries and defaults to 1 hour.
This change also ensures that the existing setting `search.default_keep_alive` is always smaller than `search.max_keep_alive`.

Relates #11511

* check style

* add skip for bwc

* iter

* Add a maxium throttle wait time of 1h for reindex

* review

* remove empty line
@lcawl lcawl added v6.0.1 and removed v6.0.0 labels Nov 13, 2017
@lcawl lcawl added v6.0.2 and removed v6.0.1 labels Dec 6, 2017
@jaymode jaymode added v6.0.3 and removed v6.0.2 labels Dec 13, 2017
@jpountz
Copy link
Contributor

jpountz commented Mar 14, 2018

Most of the work has been done, and items that have not been done have an assigned issue so I'll close this issue. Thanks everyone!

@jpountz jpountz closed this as completed Mar 14, 2018
@javanna javanna added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label :Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Meta :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v6.0.3
Projects
None yet
Development

No branches or pull requests