-
Notifications
You must be signed in to change notification settings - Fork 1.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
Replace parameter 'master_timeout' with 'cluster_manager_tiemout' in RequestConverters of High-Level-Rest-Client #2683
Replace parameter 'master_timeout' with 'cluster_manager_tiemout' in RequestConverters of High-Level-Rest-Client #2683
Conversation
Signed-off-by: Tianli Feng <ftianli@amazon.com>
d15b979
to
2dfb976
Compare
❌ Gradle Check failure d15b979dd227f527d665ef823145908ec479eaae |
Signed-off-by: Tianli Feng <ftianli@amazon.com>
…out(TimeValue) in RequestConverters Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Params withMasterTimeout(TimeValue masterTimeout) { | ||
return putParam("master_timeout", masterTimeout); | ||
} | ||
|
||
Params withClusterManagerTimeout(TimeValue clusterManagerTimeout) { | ||
return putParam("cluster_manager_timeout", clusterManagerTimeout); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is the core change for this PR, using parameter "cluster_manager_timeout" instead of "master_timeout" to build REST requests can avoid the deprecation warning.
Looking at the files, it looks like a direct replacement of the terms, even in the case of tests even though the parameter is just deprecated. Should we add in duplicate tests around the deprecated term to ensure that the change is non breaking? We can test for the warning instead. |
Hi @kotwanikunal Thanks for reviewing! |
@kotwanikunal Thanks for the reminding. I didn't realize that this will be a breaking change for the High Level Rest Client, which makes it can not communicate with OpenSearch 1.x. The problem is: There are 3 options to deal with the parameter in High Level Rest Client:
In the documentation, it's said 1.x client works with 1.x server, so it's reasonable for the 2.x client to only support 2.x server. |
A follow up, I will find out the exact impact to users about the deprecation warning in the response header. If the impact is subtle, I will keep using "master_timeout" in the RestClient to build requests and add "expectWarnings()" into tests. |
Replaced by PR #2912 to keep the backwards compatibility of Rest Client 2.x with server 1.x . |
The change can exist in version >= 3.0 |
Description
This PR can only be merged after all the other PRs listed in the description of issue #2511 (except #2744) are merged.
[^ Prerequisite achieved]
In
server
directory, the REST API parametermaster_timeout
is deprecated in version 3.0 (and will be removed in 4.0) to support inclusive naming, and alternative parametercluster_manager_timeout
is introduced (in version 2.0, in issue #2511).Correspondingly, the new parameter should be used in the High-Level-Rest-Client, which will be done by this PR.
Please note the change will break the compatibility for High-Level-Rest-Client version 3.0 with server 1.x (and below), which means High-Level-Rest-Client version 3.0 will only support server 2.x and 3.x (4.x not exist yet).
cluster_manager_timeout
instead ofmaster_timeout
in High-Level-Rest-ClientRequestConverters
class for building REST requests (Otherwise:client:rest-high-level:asyncIntegTest
tests will be broken caused by usingmaster_timeout
generating deprecation warning) (in commit 2dfb976)Issues Resolved
A part of issue #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.