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 a template parameter to override auto_create_index value #64208

Merged
merged 16 commits into from
Nov 5, 2020

Conversation

pugnascotia
Copy link
Contributor

Backport of #61858.

Closes #20640.

This PR introduces a new parameter to v2 templates, allow_auto_create,
which allows templates to override the cluster setting auto_create_index.
Notes:

  • AutoCreateIndex now looks for a matching v2 template, and if its
    allow_auto_create setting is true, it overrides the usual logic.
  • TransportBulkAction previously used AutoCreateIndex to check
    whether missing indices should be created. We now rely on
    AutoCreateAction, which was already differentiating between creating
    indices and creating data streams. I've updated AutoCreateAction to
    use AutoCreateIndex. Data streams are also influenced by
    allow_auto_create, in that their default auto-create behaviour can
    be disabled with this setting.
  • Most of the Java file changes are due to introducing an extra
    constructor parameter to ComposableIndexTemplate.
  • I've added the new setting to various x-pack templates
  • I added a YAML test to check that watches can be created even when
    auto_create_index is false.

pugnascotia and others added 3 commits October 26, 2020 14:37
…#61858)

Closes elastic#20640.

This PR introduces a new parameter to v2 templates, `allow_auto_create`,
which allows templates to override the cluster setting `auto_create_index`.
Notes:

   * `AutoCreateIndex` now looks for a matching v2 template, and if its
     `allow_auto_create` setting is true, it overrides the usual logic.
   * `TransportBulkAction` previously used `AutoCreateIndex` to check
     whether missing indices should be created. We now rely on
     `AutoCreateAction`, which was already differentiating between creating
     indices and creating data streams.  I've updated `AutoCreateAction` to
     use `AutoCreateIndex`. Data streams are also influenced by
     `allow_auto_create`, in that their default auto-create behaviour can
     be disabled with this setting.
   * Most of the Java file changes are due to introducing an extra
     constructor parameter to `ComposableIndexTemplate`.
   * I've added the new setting to various x-pack templates
   * I added a YAML test to check that watches can be created even when
     `auto_create_index` is `false`.
@pugnascotia pugnascotia added >enhancement :Data Management/Indices APIs APIs to create and manage indices and templates backport v7.11.0 labels Oct 27, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Oct 27, 2020
@pugnascotia
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@pugnascotia
Copy link
Contributor Author

@elasticmachine update branch

@pugnascotia
Copy link
Contributor Author

@elasticmachine update branch

@pugnascotia pugnascotia requested a review from martijnvg November 5, 2020 14:55
Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@pugnascotia pugnascotia merged commit e21b2e0 into elastic:7.x Nov 5, 2020
@pugnascotia pugnascotia deleted the 20640-auto-create-templates-7x branch November 5, 2020 15:12
imotov added a commit that referenced this pull request Nov 5, 2020
Fixes the serialization version after backport of #64208
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Data Management/Indices APIs APIs to create and manage indices and templates >enhancement Team:Data Management Meta label for data/management team v7.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants