Skip to content

Wrong behaviour deleting alias. #23960

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

Closed
myrfy001 opened this issue Apr 7, 2017 · 5 comments
Closed

Wrong behaviour deleting alias. #23960

myrfy001 opened this issue Apr 7, 2017 · 5 comments
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates good first issue low hanging fruit

Comments

@myrfy001
Copy link

myrfy001 commented Apr 7, 2017

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"
      }
    }
  ]
}
@olcbean
Copy link
Contributor

olcbean commented Apr 7, 2017

This looks like a low hanging fruit. If so, I would like to have a look at it.

@jimczi jimczi added help wanted adoptme >bug good first issue low hanging fruit labels Apr 7, 2017
@jimczi
Copy link
Contributor

jimczi commented Apr 7, 2017

@olcbean I just marked the issue as adopt me ;)

@jimczi jimczi added the :Aliases label Apr 7, 2017
@bytetwin
Copy link

bytetwin commented Apr 8, 2017

@jimczi I am a first timer and would like to work on this issue. Could you please share the file where I can start to look at ?

@kunal642
Copy link
Contributor

@myrfy001 i cannot replicate the issue. I have followed the step and i am able to query bar_bar with the alias foo.

@jimczi
Copy link
Contributor

jimczi commented Apr 11, 2017

@kunal642 the last step of the reproduction has a typo. I can reproduce the problem with the following request:

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

The problem here is that we resolve index: foo* to all indices and aliases that match the pattern.
@olcbean has a PR open that resolve the pattern on indices only.

@javanna javanna changed the title Wrong behavier deleting alias. Wrong behaviour deleting alias. Apr 28, 2017
@javanna javanna self-assigned this May 24, 2017
@javanna javanna removed the help wanted adoptme label May 24, 2017
@javanna javanna closed this as completed in 0d5f395 Jun 6, 2017
@clintongormley clintongormley added :Data Management/Indices APIs APIs to create and manage indices and templates and removed :Aliases labels Feb 13, 2018
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 good first issue low hanging fruit
Projects
None yet
Development

No branches or pull requests

7 participants