Default reindex to return first 50 bulk failures #20461
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reindex, update_by_query, and delete_by_query work in batches based
on the scroll size of their source query, defaulting to 1000 documents
at a time. If all 1000 of those documents fail this returns an
avalanche of errors which is just fine over the Java API and, probably,
fine for any programatic consumers over the REST API as well. But for
interactive users the size of the response can be devestating.
So this commit creates a URL parameter to control the number of
indexing failures returned in the response,
max_reported_bulk_failures
, which defaults to 50. The optionalso exists in the Transport Client for completeness sake but
defaults to
Integer.MAX_VALUE
because transport client users areunlikely to suffer if the response is large. Even though the
default is
Integer.MAX_VALUE
, not more thanbatch_size
errorsare ever returned because a single error causes reindex to abort
after processing the current batch.
Closes #20199