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

Get aliases for specific aliases returns all indices #27763

Closed
jasontedor opened this issue Dec 11, 2017 · 12 comments · Fixed by #29538
Closed

Get aliases for specific aliases returns all indices #27763

jasontedor opened this issue Dec 11, 2017 · 12 comments · Fixed by #29538
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates

Comments

@jasontedor
Copy link
Member

I think the behavior specified in IndexAliasesIT#testIndicesGetAliases is wrong. Namely:

  • create indices foobar, test, test123, foobarbaz, bazbar
  • add an alias alias1 -> foobar
  • add an alias alias2 -> foobar
  • execute get aliases on the transport layer specifying alias1 as the only alias to get
  • the response includes foobar, test, test123, foobarbaz, bazbar albeit with empty alias metadata for all indices except foobar which contains alias1 only
  • previously the response would only contain foobar with alias metadata for alias1

This was a breaking change resulting from #25114, the specific change in behavior arising from a change to MetaData.

I am opening this personally considering it a bug but for discussion where we might decide to only document this behavior (not my preference, I think this behavior is weird and not intuitive).

Relates #27743

@dakrone
Copy link
Member

dakrone commented Dec 13, 2017

It's worth noting that this only affects the transport layer. The REST layer doesn't include the extra indices. The transport layer should probably be changed to return only indices that contain the alias when an alias name is specified.

@jasontedor
Copy link
Member Author

The transport client is exactly what this issue is being reported for.

@antitech
Copy link

@jasontedor @dakrone
Yes Transport client got affected. Now we are explicitly filtering the indices which contains AliasMetaData. Its performance hit too for our application.

In which release /version we can expect its fix.?

@dakrone
Copy link
Member

dakrone commented Dec 13, 2017 via email

@jasontedor
Copy link
Member Author

In which release /version we can expect its fix.?

Right now you can not have any expectation, no decision has been reached.

@s1monw
Copy link
Contributor

s1monw commented Dec 15, 2017

+1

@jasontedor
Copy link
Member Author

We discussed this in Fix-it-Friday and agree that this is a bug. Would you take care of this @dakrone.

@jasontedor
Copy link
Member Author

@antitech I want to be clear that while we agree this is bug, it is not a high priority bug so there is no expectation about the timeline for a fix.

@antitech
Copy link

@jasontedor its ok. I'll apply any temporary fix for now . Just a request can you please attach this bug with aliases tag.

@cyberstorm256
Copy link

+1

martijnvg added a commit that referenced this issue Jan 22, 2018
…iases api.

If a get alias api call requests a specific alias pattern then
indices not having any matching aliases should not be included in the response.

Closes #27763
martijnvg added a commit that referenced this issue Jan 23, 2018
@martijnvg
Copy link
Member

Reopening this issue, because a qa test failed in another project, in this case the aliases were being expanded (via AliasesRequest#aliases(...)) before arriving in the transport action.

@martijnvg martijnvg reopened this Jan 23, 2018
martijnvg added a commit that referenced this issue Jan 23, 2018
@clintongormley clintongormley added :Data Management/Indices APIs APIs to create and manage indices and templates and removed :Aliases labels Feb 13, 2018
@jasontedor
Copy link
Member Author

@martijnvg Is it possible to resolve this issue?

martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Jul 2, 2018
…iases api.

If a get alias api call requests a specific alias pattern then
indices not having any matching aliases should not be included in the response.

This is a second attempt to fix this (first attempt was elastic#28294).
The reason that the first attempt was reverted is because when xpack
security is enabled then index expression (like * or _all) are resolved
prior to when a request is processed in the get aliases transport action,
then `MetaData#findAliases` can't know whether requested all where
requested since it was already expanded in concrete alias names. This
change replaces aliases(...) replaceAliases(...) method on AliasesRequests
class and leave the aliases(...) method on subclasses. So there is a distinction
between when xpack security replaces aliases and a user setting aliases via
the transport or high level http client.

Closes elastic#27763
martijnvg added a commit that referenced this issue Jul 6, 2018
…iases api. (#29538)

If a get alias api call requests a specific alias pattern then
indices not having any matching aliases should not be included in the response.

This is a second attempt to fix this (first attempt was #28294).
The reason that the first attempt was reverted is because when xpack
security is enabled then index expression (like * or _all) are resolved
prior to when a request is processed in the get aliases transport action,
then `MetaData#findAliases` can't know whether requested all where
requested since it was already expanded in concrete alias names. This
change replaces aliases(...) replaceAliases(...) method on AliasesRequests
class and leave the aliases(...) method on subclasses. So there is a distinction
between when xpack security replaces aliases and a user setting aliases via
the transport or high level http client.

Closes #27763
martijnvg added a commit that referenced this issue Jul 6, 2018
…iases api. (#29538)

If a get alias api call requests a specific alias pattern then
indices not having any matching aliases should not be included in the response.

This is a second attempt to fix this (first attempt was #28294).
The reason that the first attempt was reverted is because when xpack
security is enabled then index expression (like * or _all) are resolved
prior to when a request is processed in the get aliases transport action,
then `MetaData#findAliases` can't know whether requested all where
requested since it was already expanded in concrete alias names. This
change replaces aliases(...) replaceAliases(...) method on AliasesRequests
class and leave the aliases(...) method on subclasses. So there is a distinction
between when xpack security replaces aliases and a user setting aliases via
the transport or high level http client.

Closes #27763
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
Projects
None yet
7 participants