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

Index settings are incorrectly set to null when the setting is set by an index template #86786

Open
romain-chanu opened this issue May 14, 2022 · 1 comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team

Comments

@romain-chanu
Copy link

Elasticsearch Version

7.17.3

Installed Plugins

No response

Java Version

bundled

OS Version

Deployment in ESS

Problem Description

Index settings are incorrectly set to null when the setting is set by an index template.

Take the below situation (observed in the field). While this may not be logical, we should provide better resilience or safety to avoid this kind of situation.

  1. User can create a legacy template with the following definition:
PUT _template/default
{
  "order": -1,
  "index_patterns": [
    "*"
  ],
  "settings": {
    "index": {
      "routing": {
        "allocation": {
          "require": {
            "data": null
          }
        }
      }
    }
  },
  "mappings": {},
  "aliases": {}
}
  1. An index myindex is created (e.g PUT myindex).

  2. Checking the index settings of myindex (GET myindex/_settings), we observe that index.routing.allocation.require is set to null

{
  "myindex" : {
    "settings" : {
      "index" : {
        "routing" : {
          "allocation" : {
            "include" : {
              "_tier_preference" : "data_content"
            },
            "require" : {
              "data" : null
            }
          }
        },
        "number_of_shards" : "1",
        "provided_name" : "myindex",
        "creation_date" : "1652497877861",
        "number_of_replicas" : "1",
        "uuid" : "dT-AU9czQTmoZIBcdydB1A",
        "version" : {
          "created" : "7170399"
        }
      }
    }
  }
}

Steps to Reproduce

As described above. This also happens in version 8.2.0 as well.

Logs (if relevant)

No response

@romain-chanu romain-chanu added >bug needs:triage Requires assignment of a team area label labels May 14, 2022
@pquentin pquentin added :Data Management/Indices APIs APIs to create and manage indices and templates and removed needs:triage Requires assignment of a team area label labels May 16, 2022
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label May 16, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates Team:Data Management Meta label for data/management team
Projects
None yet
Development

No branches or pull requests

3 participants