-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Replace REST API request parameter "master_timeout" with "cluster_manager_timeout" in High Level REST Client when building requests #2928
Description
Is your feature request related to a problem? Please describe.
A part of issue #2511
A reasonable solution should be proposed to deal with the deprecation of parameter "master_timeout", while considering the compatibility for the High Level REST Client to communicate with server in different versions.
Problem:
In Server, the REST API request parameter "master_timeout" is deprecated and "cluster_manager_timeout" is added as an alternative, by the PRs listed in issue #2511 . There will be deprecation warning added in log file and HTTP response header when using the parameter "master_timeout" in REST API requests.
In High Level REST Client, parameter master_timeout was added to every applicable REST API call,
see org.opensearch.client.RequestConverters.Params.withMasterTimeout(TimeValue).
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.
Describe the solution you'd like
The adjusted plan for the REST API request parameter "master_timeout" deprecation.
- In version 2.0:
Server: add logic to accept new parameter "cluster_manager_timeout”, and no deprecation warning for the existing parameter "master_timeout"
High Level REST Client: no change (maintains compatibility with 1.x and 2.x) - In version 3.0:
Server: deprecate "master_timeout" and emit warning for usage
High Level REST Client: change usage of "master_timeout" parameter to "cluster_manager_timeout" (still compatible with 2.x and 3.x) - In version 4.0:
Server: remove support for "master_timeout"
High Level REST Client: no change
Thanks @andrross for putting up the idea.
In this way, without changing the design for High Level REST Client of dealing with "master_timeout" parameter, the High Level REST Client can still be compatible with a previous version of the server. (High level Rest Client 2.x can be compatible with server 1.x and 2.x, and High level Rest Client 3.x can be compatible with server 2.x and 3.x)
Related code change:
In version >=2.0 and <3.0:
- Remove deprecation warnings of using
master_timeoutparameter (PR: [2.x] Remove deprecation warning of using REST API request parameter 'master_timeout' #2920) - Set the High-Level-Rest-Client tests back to treating warning header as a failure. (PR: [2.x] Revert "Make High-Level-Rest-Client tests allow deprecation warning temporarily (#2702)" #2930)
In version 3.0 and above:
- Use
cluster_manager_timeoutinstead ofmaster_timeoutin High-Level-Rest-Client to fix test failures caused by deprecation warning (PR: Replace parameter 'master_timeout' with 'cluster_manager_tiemout' in RequestConverters of High-Level-Rest-Client #2683) - Set the High-Level-Rest-Client tests back to treating warning header as a failure. (PR: Revert "Make High-Level-Rest-Client tests allow deprecation warning temporarily (#2702)" #2744)
Describe alternatives you've considered
none.
Additional context
none.