Skip to content

Wrong behaviour deleting alias. #23960

@myrfy001

Description

@myrfy001

Elasticsearch version:
5.2.2
Plugins installed: []
head
JVM version:
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
OS version:
Linux 3.10.0-229.el7.x86_64
Description of the problem including expected versus actual behavior:

With two index named foo_foo and bar_bar with the same alias foo like below:

index alias
foo_foo foo
bar_bar foo

If use the following to remove the alias, only the alias of 'foo_foo' is removed, that's fine.

POST /_aliases 
{
  "actions": [
    {
      "remove": {
        "index": "foo_*",
        "alias": "foo"
      }
    }
  ]
}

BUT, if use the following to remove, both the alias of foo_foo and bar_bar will be removed, while I think only the foo_foo 's alias should be removed

POST /_aliases 
{
  "actions": [
    {
      "remove": {
        "index": "foo*",
        "alias": "foo"
      }
    }
  ]
}

Steps to reproduce:

  1. Create Two Index using the following:
PUT /foo_foo
PUT /bar_bar
  1. Add Alias for them using:
POST /_aliases
{
    "actions" : [
        { "add" : { "index" : "foo_foo", "alias" : "foo" } },
        { "add" : { "index" : "bar_bar", "alias" : "foo" } }
    ]
}
  1. delete alias using:
POST /_aliases 
{
  "actions": [
    {
      "remove": {
        "index": "foo_*",
        "alias": "foo"
      }
    }
  ]
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions