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

Do not fail whole request on closed index #6790

Conversation

spinscale
Copy link
Contributor

The bulk API request was marked as completely failed,
in case a request with a closed index was referred in
any of the requests inside of a bulk one.

Implementation Note: Currently the implementation is a bit more verbose in order to prevent an instanceof check and another cast - if that is fast enough, we could execute that logic only once at the beginning of the loop (thinking this might be a bit overoptimization here).

Closes #6410

@spinscale spinscale added review and removed bug labels Jul 8, 2014
@clintongormley
Copy link

@spinscale would this fix also handle the case mentioned in #6410 (comment) when indexing into a non-existent index with action.auto_create_index set to false?

String type = null;
String id = null;
boolean isClosed = false;
if (request instanceof IndexRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

dude can we extract and interface that we can implement on all of them that allows use to return index, type, id?

@s1monw
Copy link
Contributor

s1monw commented Jul 9, 2014

added some comments

@s1monw s1monw removed the review label Jul 9, 2014
The bulk API request was marked as completely failed,
in case a request with a closed index was referred in
any of the requests inside of a bulk one.

Closes elastic#6410
@spinscale
Copy link
Contributor Author

@clintongormley added another test when action.auto_create_index is set to false
@s1monw added an interface and thus refactored to the code...

*
* Forces this class return index/type/id getters
*/
public interface SingleDocumentWriteRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we should call it Indexable or DocumentRequest something like this and it should also have a routing or even better the common denominator of update / delete / index ie all the methods they share?

@s1monw
Copy link
Contributor

s1monw commented Jul 15, 2014

I added some comments

@GaelTadh GaelTadh closed this Sep 19, 2014
@clintongormley clintongormley changed the title Bulk API: Do not fail whole request on closed index Do not fail whole request on closed index Jun 7, 2015
@lcawl lcawl added :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Bulk labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. v1.4.0.Beta1 v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bulk request against multiple indices fails on missing index instead of failing individual actions
5 participants