Skip to content

Throw an illegal_argument_exception when max_docs is less than slices #54901

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

Merged
merged 2 commits into from
May 28, 2020

Conversation

gaobinlong
Copy link
Contributor

Relates to #52786.

When the parameter max_docs is less than slices in update_by_query, delete_by_query or reindex API, max_docs is set to 0 and we throw an action_request_validation_exception with confused error message: "maxDocs should be greater than 0...".
This change checks that whether max_docs is less than slices and throw an illegal_argument_exception with clear message.

@cbuescher cbuescher added the :Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down label Apr 8, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Reindex)

@gaobinlong
Copy link
Contributor Author

Anyone can help to review this change?

@rjernst rjernst added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label May 4, 2020
@ywelsch ywelsch requested a review from henningandersen May 27, 2020 12:50
@henningandersen
Copy link
Contributor

@elasticmachine test this please

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks @gaobinlong for your contribution.

@henningandersen henningandersen merged commit 6e64362 into elastic:master May 28, 2020
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this pull request May 29, 2020
When the parameter `max_docs` is less than `slices` in update_by_query,
delete_by_query or reindex API, `max_docs ` is set to 0 and we throw an
action_request_validation_exception with confused error message:
"maxDocs should be greater than 0...".
This change checks that whether `max_docs` is less than `slices` and
throw an illegal_argument_exception with clear message.

Relates to elastic#52786.
henningandersen added a commit that referenced this pull request May 29, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
When the parameter `max_docs` is less than `slices` in update_by_query,
delete_by_query or reindex API, `max_docs ` is set to 0 and we throw an
action_request_validation_exception with confused error message:
"maxDocs should be greater than 0...".
This change checks that whether `max_docs` is less than `slices` and
throw an illegal_argument_exception with clear message.

Relates to #52786.

Co-authored-by: bellengao <gbl_long@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Reindex Issues relating to reindex that are not caused by issues further down >enhancement Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants