[2.x] Remove deprecation warning of using REST API request parameter 'master_timeout'#2920
Merged
tlfeng merged 4 commits intoopensearch-project:2.xfrom Apr 15, 2022
Conversation
5 tasks
Collaborator
|
❌ Gradle Check failure 45f31149c1c2b6b9e60c8631345d8dc6c97de75e |
added 2 commits
April 15, 2022 13:08
…r_timeout' Signed-off-by: Tianli Feng <ftianli@amazon.com>
…r_timeout' - comment out part Signed-off-by: Tianli Feng <ftianli@amazon.com>
45f3114 to
fb59fcf
Compare
Signed-off-by: Tianli Feng <ftianli@amazon.com>
…n 2 action classes Signed-off-by: Tianli Feng <ftianli@amazon.com>
tlfeng
commented
Apr 15, 2022
|
|
||
| protected static final String DUPLICATE_PARAMETER_ERROR_MESSAGE = | ||
| "Please only use one of the request parameters [master_timeout, cluster_manager_timeout]."; | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Note: I moved the constant String outside the method to make it directly used in RestIndicesAction and RestAllocationAction classes in below change. In these 2 classes, the method parseDeprecatedMasterTimeoutParameter() can not fit the requirement, so need the error message used outside the BaseRestHandler, directly in the 2 classes.
tlfeng
commented
Apr 15, 2022
| logger.deprecate(logMsgKeyPrefix + "_master_timeout_parameter", MASTER_TIMEOUT_DEPRECATED_MESSAGE); | ||
| if (request.hasParam("cluster_manager_timeout")) { | ||
| throw new OpenSearchParseException(DUPLICATE_PARAMETER_ERROR_MESSAGE); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Note: the method arguments logger and logMsgKeyPrefix are removed since they are not used without deprecation warning.
andrross
approved these changes
Apr 15, 2022
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Apr 15, 2022
…'master_timeout' (#2920) The plan of deprecation parameter "master_timeout" changed to not show deprecation warning of 'master_timeout' parameter in 2.x version, but start to emit warning from version 3.0 . For the detailed plan, see issue #2928. Signed-off-by: Tianli Feng <ftianli@amazon.com> (cherry picked from commit 8bc5765)
11 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The REST API request parameter 'master_timeout' is deprecated in issue #2511.
The PR removes the deprecation warning when assigning value to the parameter 'master_timeout'.
The plan of deprecation parameter "master_timeout" changed to not show deprecation warning of 'master_timeout' parameter in 2.x version, but start to emit warning from version 3.0 .
For the detailed plan, see issue #2928.
Reason:
This is a compromise with the High Level REST Client (https://github.com/opensearch-project/OpenSearch/tree/1.3.1/client/rest-high-level).
In High Level REST Client, parameter 'master_timeout' is added to every applicable REST API call,
see org.opensearch.client.RequestConverters.Params.withMasterTimeout(TimeValue).
To keep the compatibility of Rest Client 2.x with server 1.x, the parameter 'master_timeout' is preserved.
Emitting deprecation warning in log file and HTTP response header in this case will confuse the user, because the deprecated parameter is not actively used by the user.
Issues Resolved
A part of issue #2928 and #2511
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.