-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
No way to specify auto-slice in an AbstractBulkByScrollRequest #53044
Comments
Pinging @elastic/es-search (:Search/Search) |
Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client) |
Hi, thanks for raising the issue. I would like to clarify if all your above observations are based on trying to send the request using the HLRC.
I think the problem here is that we provide a way to set the '0' value representing "auto" on the request itself, but we cannot pass this through the Rest layer. I think we need to be more lenient in the above mentioned "parse" method. |
Currently the AbstractBulkByScrollRequest accepts slice values of 0 via its `setSlices` method, denoting the "auto" slicing behaviour that is usable by settting the "slices=auto" parameter on rest requests. When using the High Level Rest Client, however, we send the 0 value as an integer, which is then rejected as invalid by `AbstractBulkByScrollRequest#parseSlices`. Instead of making parsing of the rest request more lenient, this PR opts for changing the RequestConverter logic in the client to translate 0 values to "auto" on the rest requests. Closes elastic#53044
@tc027 in case my assumption mentioned above is true, I opened a PR that should adress the High Level Rest Client behaviour when translating this parameter. |
That is indeed the case, yes.
Thank you for implementing a fix so promptly. |
Any chance of getting this into a 7.6.x patch releases? |
Currently the AbstractBulkByScrollRequest accepts slice values of 0 via its `setSlices` method, denoting the "auto" slicing behaviour that is usable by settting the "slices=auto" parameter on rest requests. When using the High Level Rest Client, however, we send the 0 value as an integer, which is then rejected as invalid by `AbstractBulkByScrollRequest#parseSlices`. Instead of making parsing of the rest request more lenient, this PR opts for changing the RequestConverter logic in the client to translate 0 values to "auto" on the rest requests. Closes #53044
Currently the AbstractBulkByScrollRequest accepts slice values of 0 via its `setSlices` method, denoting the "auto" slicing behaviour that is usable by settting the "slices=auto" parameter on rest requests. When using the High Level Rest Client, however, we send the 0 value as an integer, which is then rejected as invalid by `AbstractBulkByScrollRequest#parseSlices`. Instead of making parsing of the rest request more lenient, this PR opts for changing the RequestConverter logic in the client to translate 0 values to "auto" on the rest requests. Closes #53044
Currently the AbstractBulkByScrollRequest accepts slice values of 0 via its `setSlices` method, denoting the "auto" slicing behaviour that is usable by settting the "slices=auto" parameter on rest requests. When using the High Level Rest Client, however, we send the 0 value as an integer, which is then rejected as invalid by `AbstractBulkByScrollRequest#parseSlices`. Instead of making parsing of the rest request more lenient, this PR opts for changing the RequestConverter logic in the client to translate 0 values to "auto" on the rest requests. Closes #53044
Should be in 7.6.2 |
It would be really nice to have this feature in |
Elasticsearch version: 7.6.0
JVM version:
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)
OS version: Windows 10
Description of the problem including expected versus actual behavior:
There is no way to specify auto-slice in an AbstractBulkByScrollRequest. AbstractBulkByScrollRequest.setSlices only takes an int but AbstractBaseReindexRestHandler.parseSlices checks for an 'auto' string, which is impossible provide via the Java High Level REST Client. Simply providing '0' instead does not work either as this causes parseSlices to throw an exception.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: