Skip to content

Shrink API attempts to apply mapping from index templates. #25035

@A-Hall

Description

@A-Hall

Elasticsearch version: 5.3

Plugins installed: Cerebro, X-Pack

JVM version (java -version): 1.8.0_66

OS version (uname -a if on a Unix-like system): RHEL 7.3

Description of the problem including expected versus actual behavior: When trying to call shrink API and the destination index matches a template that provides mappings they get an error:

{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[xxx-master][x.x.x.x:9300][indices:admin/shrink]"}],"type":"illegal_argument_exception","reason":"mappings are not allowed when shrinking indices, all mappings are copied from the source index"},"status":400}

It would be nice if the shrink API bypassed checking for index templates that match the destination index. The error is misleading too since no mappings were provided by the user.

Steps to reproduce:

  1. Create index template for FooIndex* that includes a mapping.
  2. Create index that matches index pattern FooIndex*
  3. Call Shrink API for index created in step 2, making destination index also match the pattern FooIndex*.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Data Management/Indices APIsDO NOT USE. Use ":Distributed/Indices APIs" or ":StorageEngine/Templates" instead.>bughelp wantedadoptme

    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