f5b2dfd052
Fixes a bug where alias creation would allow `null` for index name, which thereby applied the alias to _all_ indices. This patch makes the validator throw an exception if the index is null. ```bash POST /_aliases { "actions": [ { "add": { "alias": "empty-alias", "index": null } } ] } ``` ```json { "error": "ActionRequestValidationException[Validation Failed: 1: Alias action [add]: [index] may not be null;]", "status": 400 } ``` The reason this bug wasn't caught by the existing tests is because the old test for nullness only validated against a cluster which had zero indices. The null index is translated into "_all", and since there are no indices, this fails because the index doesn't exist. So the test passes. However, as soon as you add an index, "_all" resolves and you get the situation described in the original bug report: null index is accepted by the alias, resolves to "_all" and gets applied to everything. The REST tests, otoh, explicitly tested this bug as a real feature and therefore passed. The REST tests were modified to change this behavior. Fixes #7863 |
||
---|---|---|
.. | ||
community | ||
groovy-api | ||
java-api | ||
javascript | ||
perl | ||
python | ||
reference | ||
resiliency | ||
river | ||
ruby | ||
README.md |
README.md
The Elasticsearch docs are in AsciiDoc format and can be built using the Elasticsearch documentation build process