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

Internal: streamline use of IndexClosedException #6988

Closed
javanna opened this issue Jul 23, 2014 · 3 comments · Fixed by #6990
Closed

Internal: streamline use of IndexClosedException #6988

javanna opened this issue Jul 23, 2014 · 3 comments · Fixed by #6990

Comments

@javanna
Copy link
Member

javanna commented Jul 23, 2014

With #6475 we introduced the use of a new IndexClosedException that gets thrown whenever we refer to closed indices within apis that don't allow them (behaviour can also be changed through indices options in some cases). We should streamline the use of this exception and use it within single index apis like index api, which currently return an index block during the execution while we could throw the newly added IndexClosedException instead.

@clintongormley
Copy link

@javanna I've labelled this as adoptme, unless you're planning on doing it? if so, could you assign it to yourself please?

@javanna javanna removed the adoptme label Jul 23, 2014
@javanna javanna self-assigned this Jul 23, 2014
@javanna
Copy link
Member Author

javanna commented Jul 23, 2014

Working on it @clintongormley ;)

@javanna javanna changed the title Streamline use of IndexClosedException Internal: streamline use of IndexClosedException Jul 23, 2014
@javanna
Copy link
Member Author

javanna commented Jul 23, 2014

Marking this as breaking as this change affects what we return when using one of the following apis against closed indices: analyze, bulk, index, update, delete, explain, get, multi_get, mlt, term vector, multi_term vector. We now return:

{"error":"IndexClosedException[[test] closed]","status":403}

instead of

{"error":"ClusterBlockException[blocked by: [FORBIDDEN/4/index closed];]","status":403}

javanna added a commit to javanna/elasticsearch that referenced this issue Jul 24, 2014
…tion on closed indices

Single index operations to use the newly added IndexClosedException introduced with elastic#6475. This way we can also fail faster when we are trying to execute operations on closed indices and their use is not allowed (depending on indices options). Indices blocks are still checked but we can already throw error while resolving indices (MetaData#concreteIndices).

Effectively this change also affects what we return when using one of the following apis: analyze, bulk, index, update, delete, explain, get, multi_get, mlt, term vector, multi_term vector. We now return `{"error":"IndexClosedException[[test] closed]","status":403}` instead of `{"error":"ClusterBlockException[blocked by: [FORBIDDEN/4/index closed];]","status":403}`.

Closes elastic#6988
javanna added a commit that referenced this issue Jul 24, 2014
…tion on closed indices

Single index operations to use the newly added IndexClosedException introduced with #6475. This way we can also fail faster when we are trying to execute operations on closed indices and their use is not allowed (depending on indices options). Indices blocks are still checked but we can already throw error while resolving indices (MetaData#concreteIndices).

Effectively this change also affects what we return when using one of the following apis: analyze, bulk, index, update, delete, explain, get, multi_get, mlt, term vector, multi_term vector. We now return `{"error":"IndexClosedException[[test] closed]","status":403}` instead of `{"error":"ClusterBlockException[blocked by: [FORBIDDEN/4/index closed];]","status":403}`.

Closes #6988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants