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 send default ignore_throttled parameter since it is deprecated #84827

Merged
merged 3 commits into from
Mar 10, 2022

Conversation

wiggzz
Copy link

@wiggzz wiggzz commented Mar 9, 2022

Why

When setting indices options in the (now deprecated) RestHighLevelClient, even if we do not explicitly set ignore_throttled, the client sends the ignore_throttled parameter to the server. Since 7.16, this parameter is deprecated, and so the server sends back a warning header which is unconditionally logged.

This is extremely spammy in our environments because we usually set non-deprecated indices options, and so all of our requests are sending (without our control) the ignore_throttled parameter.

The RestHighLevelClient should not send the deprecated ignore_throttled parameter unless it is set to the non default value of false.

What

This PR changes the RequestConverters to only send the ignore_throttled parameter when it is set to a non-default value. Otherwise it does not include it.

Other notes

Happy to submit this against master however this should most definitely be available in the version where the deprecation was introduced (7.16) so I targeted that branch.

@elasticsearchmachine elasticsearchmachine added v7.16.4 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Mar 9, 2022
@wiggzz wiggzz changed the title Do not send default ignore_throttled paramter since it is deprecated Do not send default ignore_throttled parameter since it is deprecated Mar 9, 2022
@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Mar 10, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@DaveCTurner
Copy link
Contributor

@elasticmachine ok to test

@swallez
Copy link
Member

swallez commented Mar 10, 2022

@wiggzz thanks for the fix. Unfortunately there will be no new release in the 7.16 branch, so can you please target 7.17?

Also CheckStyle report code formatting errors: running ./gradlew precommit will outline these.

And finally, can you include the following releases notes in docs/changelog/84827.yaml?

pr: 84827
summary: Do not send default ignore_throttled parameter since it is deprecated
area: Java High Level REST Client
type: bug
issues:
 - []

Thanks!

@wiggzz wiggzz changed the base branch from 7.16 to 7.17 March 10, 2022 16:13
@wiggzz
Copy link
Author

wiggzz commented Mar 10, 2022

@wiggzz thanks for the fix. Unfortunately there will be no new release in the 7.16 branch, so can you please target 7.17?

Also CheckStyle report code formatting errors: running ./gradlew precommit will outline these.

And finally, can you include the following releases notes in docs/changelog/84827.yaml?

pr: 84827
summary: Do not send default ignore_throttled parameter since it is deprecated
area: Java High Level REST Client
type: bug
issues:
 - []

Thanks!

@swallez done

Copy link
Member

@swallez swallez 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 again for the fix @wiggzz!

@swallez swallez merged commit 4c41c7a into elastic:7.17 Mar 10, 2022
@wiggzz
Copy link
Author

wiggzz commented Mar 10, 2022

LGTM. Thanks again for the fix @wiggzz!

@swallez Thanks for the quick review and merge!

@massivespace
Copy link

massivespace commented May 8, 2023

FYI for anyone running into this issue. This fix only works if you have the ignore_throttled flag in your options. We were using the lenient option set that did not have the ignore_throttled option, and were still getting this warning. The code only ignores the flag (i.e. doesn't add it to the rest request) if the flag is set to true, so we had to add the ignore_throttled flag into our indicesOptions options in order to disable it.

Reference code in RequestConverters.java:
if (indicesOptions.ignoreThrottled() == false) { putParam("ignore_throttled", Boolean.toString(indicesOptions.ignoreThrottled())); }
Just to clarify, the default value is ignore_throttled=true, so there was nothing wrong with this PR. In our case, we weren't using throttled indices anyway, so adding this flag back in resolved the warning for us (thanks to this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug external-contributor Pull request authored by a developer outside the Elasticsearch team Team:Data Management Meta label for data/management team v7.17.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants