-
Notifications
You must be signed in to change notification settings - Fork 25k
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
ES Indices /GET api return closed indices if they have aliases assigned. #45171
Comments
Pinging @elastic/es-distributed |
Hey @SthPhoenix , Thanks for this bug report. I am not sure I see the problem here. The most typical API to get a list of indices is Testing closing an index without an alias shows:
Testing closing an index with an alias shows:
|
@SthPhoenix I can't reproduce this (on 7.2.0 at least): I tried:
Are these the same reproduction steps you followed? |
I am using python client (7.0.0) for this, but yes, steps are the same. For checking indices list I also used curl. |
To clarify: if you follow my earlier steps using curl, does step 5. i.e. |
Yes, using curl gives same strange behavior. |
@SthPhoenix Did you manage to reproduce or to figure out the reason? Looking at the code, the GET Indices API should only return opened indices on 6.x, 7.x and master as it uses the "strict expand open" option. It is possible that the Elasticsearch Python Client sets a different indices options that allow closed indices to be included in the response, but looking at the client code it does not seem to be the case. Also, I'm curious to know if any of the clusters you tested have the Security enabled? |
Hi @tlrx ! I won't have access to the cluster with this error till the end of next week.
Since this behavior is also reproduced with curl requests, I think ES python client is out of question.
Yes, I have security enabled on the cluster. |
@SthPhoenix Thanks for the extra information.
Agreed, I just wanted to double check.
That's what I suspected, and indeed this bug can be reproduced on 7.1/7.2 (maybe also later versions) but it only appears when security is enabled. |
Pinging @elastic/es-security |
I have checked it on a single node with security. Yes, it looks like the bug can be reproduced only with security enabled. |
Connected bug found: |
This is the same root problem as #32238. Unfortunately this is a limitation when security is enabled which has been around, essentially forever and is very hard to fix unless we either:
|
Another option is to change how expand_wildcards works in core (breaking change) so as to make it compatible with how Security currently functions. Wildcards that match aliases that point to both closed and open indices can be made to expand to only open, closed indices or both . To honor this option ES core needs wildcards in the index expression . But the Security Filter cannot forward wildcards. We could deprecate |
Elasticsearch version: 7.1.0, 7.2.0
Plugins installed: [analysis-icu, analysis-smartc, analysis-phonetic]
JVM version : bundled
OS version: Ubuntu 18.04.2
Description of the problem including expected versus actual behavior:
Actual: Elasticsearch Indices /GET API return closed indices if they has assigned aliases.
Expected: ES should return only opened indices.
Aliases are unique to closed indices, and there are no opened indices sharing same aliases.
Steps to reproduce:
GET http://elasticsearch.host:9200/*
to get list of indices including closed just now.GET http://elasticsearch.host:9200/*
to get list of indices without closed one.The text was updated successfully, but these errors were encountered: