Skip to content

make identificaiton of closed indices more clear #25253

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
wants to merge 3 commits into from
Closed

make identificaiton of closed indices more clear #25253

wants to merge 3 commits into from

Conversation

dzmitry-lahoda
Copy link

No description provided.

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @asd-and-Rizzo thanks for your PR I requested a change.

@@ -32,3 +32,5 @@ This setting can also be changed via the cluster update settings api.

Closed indices consume a significant amount of disk-space which can cause problems in managed environments. Closing indices can be disabled via the cluster settings
API by setting `cluster.indices.close.enable` to `false`. The default is `true`.

Closed index responses with `index_closed_exception` and `403` status on call to `_stats` API. Closed indices are not returned in cross index `_aliases` or `_stats` API responses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are many more APIs that return IndexClosedException and 403 status code when executed against closed indices. For instance _search. But through the ignore_unavailable parameter, you can decide whether to ignore those closed indices or get an exception back instead. I would rephrase your new paragraph without mentioning any specific APIs, rather say "most APIs don't support execution against closed indices, hence `ignore_unavailable allows to control whether closed indices are skipped or cause an IndexClosedException to be returned". What do you think?

@javanna javanna self-assigned this Jun 16, 2017
@dzmitry-lahoda
Copy link
Author

I will check ignore_unavailable behavior and update as recommend within next 2 weeks.

@javanna
Copy link
Member

javanna commented Jun 19, 2017

thanks @asd-and-Rizzo please ping me once you've done so

I have document behavior of closed index on single index call and multiple index call. I see problem here, at least for my product. How do we know that index is closed or there are closed indices via API because these are not visible from cross index wildcard calls? Should we store index list externally to ES?
@dzmitry-lahoda
Copy link
Author

@javanna, Please check my comment in patch. I see your thinking of closed behavior could be different from what I see. What does ES version your knowledge steam from?

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @asd-and-Rizzo I left a couple more comments. My feedback doesn't stem from any specific Elasticsearch version, ignore_unavailable is supported for a very long time now. Let me know if you have any further questions.

@@ -32,3 +32,7 @@ This setting can also be changed via the cluster update settings api.

Closed indices consume a significant amount of disk-space which can cause problems in managed environments. Closing indices can be disabled via the cluster settings
API by setting `cluster.indices.close.enable` to `false`. The default is `true`.

Closed index responses with `index_closed_exception` and `403` for most APIs, including `_stats` and `_search`. `ignore_unavailable` allows to control whether closed index do not cause `index_closed_exception` to be returned. Index returns value on call to `_aliases`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would slightly rephrase this sentence: "Most APIs, including _stats and _search, return index_closed_exception and 403 status code when accessing closed indices. The `ignore_unavailable querystring parameter allows to control whether closed indices cause an error to be returned or not.".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with "Index returns value on call to _aliases" ?


Closed index responses with `index_closed_exception` and `403` for most APIs, including `_stats` and `_search`. `ignore_unavailable` allows to control whether closed index do not cause `index_closed_exception` to be returned. Index returns value on call to `_aliases`.

Closed indices are not returned in most wildcard index API calls, like `_aliases`, `_stats` or `_search`, nor throw any exceptions and behave like non-existent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this sentence. You control through ignore_unavailable whether closed indices throw error or not. They are unavailable indices for most of the APIs, hence either they are ignored or they cause an error (e.g. it is not technically possible to search against a closed index, so the question is just what to do instead: error or skip them?)

@dzmitry-lahoda
Copy link
Author

dzmitry-lahoda commented Jul 22, 2017

Here is case:
/my_index
/my_closed_index

  1. Request:
    /_aliases
    Response:
    /my_index

  2. Request:
    /my_closed_index/_aliases
    Response:
    /my_closed_index

  3. Request:
    /_search
    Response:
    Some values from my_index
    No error from my_closed_index.

  4. Request:
    /my_closed_index/_search?ignore_unavailable
    Response:
    Zero hits.

  5. Request:
    /my_closed_index/_search
    Response:
    Error.

From these I conclude next:

  1. I should keep external list of indices to be able to delete them later (e.g. because of my retention policy we do close and then delete) or access ES cluster directly, not via API, to find the list.
  2. ignore_unavailable does not work on multi indeces requests. So it makes ignore_unavailable useless in some situations.

So the problem is what is correct and useful specification of closed indices calls and usage of ignore_unavailable?

I will rephrase the sentence, but current behavior of closed indexes does not feel consistent for me.

@javanna
Copy link
Member

javanna commented Jul 24, 2017

hi @asd-and-Rizzo we'd like users to ask questions in our forums, as we reserve github issues for verified bug reports and feature requests.

From your example I see that ignore_unavailable does work with e.g. the search API. But I am not clear on the following statement:

ignore_unavailable does not work on multi indeces requests. So it makes ignore_unavailable useless in some situations.

Please do open another issue if you think that the above is a bug rather than commenting here.

This other issue may be interesting too: #9438

@dzmitry-lahoda
Copy link
Author

@javanna, thanks for reference to forum and other issues. My pull request was only about to add documentation about current behavior, no expectancy to change this behavior. Just helping our support team and hoping that current behavior inconsistencies(as I see these) will be visible to other people.

@colings86 colings86 added v5.5.3 and removed v5.5.2 labels Aug 8, 2017
Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry @asd-and-Rizzo it took me a while to have another look, I left some more comments. Could you address those so I can get your PR in?

@@ -32,3 +32,10 @@ This setting can also be changed via the cluster update settings api.

Closed indices consume a significant amount of disk-space which can cause problems in managed environments. Closing indices can be disabled via the cluster settings
API by setting `cluster.indices.close.enable` to `false`. The default is `true`.

Most APIs, including _stats and _search, return `index_closed_exception` and 403 status code when accessing closed index. The `ignore_unavailable` querystring parameter allows to control whether closed index cause an error to be returned or not. Call to index `_aliases` returns correct value without error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

403 recently became 400 . Can you update that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when accessing closed indices

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whether closed indices cause an error to be returned or are skipped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this sentence confusing: "Call to index _aliases returns correct value without error. " I would remove it.


Most APIs, including _stats and _search, return `index_closed_exception` and 403 status code when accessing closed index. The `ignore_unavailable` querystring parameter allows to control whether closed index cause an error to be returned or not. Call to index `_aliases` returns correct value without error.

Closed indices are not returned in most wildcard API calls, like `_aliases`, `_stats` or `_search`, nor throw any exceptions. Closed indices behave like non-existent, closed indices will not be returned during call to `_aliases`. Passing `ignore_unavailable` is irrelevant to wildcard indices calls.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expand_wildcards allows to control whether to expand wildcards against open, closed or both. can you update this sentence please?

@colings86 colings86 added v5.5.4 and removed v5.5.3 labels Aug 25, 2017
@javanna
Copy link
Member

javanna commented Nov 6, 2017

There has been no activity on this for two months, I am closing. Feel free to reopen once the comments are addressed.

@javanna javanna closed this Nov 6, 2017
@lcawl lcawl removed the v6.1.0 label Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes v5.5.4 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants