Replace REST API request parameter "master_timeout" with "cluster_manager_timeout" in High Level REST Client when building requests #2928
Labels
deprecate
enhancement
Enhancement or improvement to existing feature or request
v3.0.0
Issues and PRs related to version 3.0.0
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.
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)
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)
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:
master_timeout
parameter (PR: [2.x] Remove deprecation warning of using REST API request parameter 'master_timeout' #2920)In version 3.0 and above:
cluster_manager_timeout
instead ofmaster_timeout
in 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)Describe alternatives you've considered
none.
Additional context
none.
The text was updated successfully, but these errors were encountered: