Skip to content

Clone index does not keep "number_of_replicas" setting, nor it respects index templates #74135

@pmishev

Description

@pmishev

Elasticsearch version (bin/elasticsearch --version): 7.12.1

Description of the problem including expected versus actual behavior:

There could as well be 2 unrelated problems:

  1. When cloning an index, number_of_replicas of the target index is not kept the same as the source index.

  2. If there is an index template that sets the number_of_replicas to 0, this is being ignored as well, although the target index name matches the template pattern

Steps to reproduce:

PUT _index_template/template_1
{
  "index_patterns": ["mytest*"],
  "template": {
    "settings": {
      "number_of_replicas" : 0
    }
  }
}
PUT mytest1
GET mytest1

Observe that number_of_replicas = 0, as expected.

PUT /mytest1/_settings
{
  "settings": {
    "index.blocks.write": true
  }
}
POST /mytest1/_clone/mytest2
GET mytest2

Observe that number_of_replicas = 1, so the value was neither copied over from the source index, nor the index template was respected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Data Management/Indices APIsDO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead.>bug>docsGeneral docs changesTeam:Data Management (obsolete)DO NOT USE. This team no longer exists.Team:DocsMeta label for docs team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions