Skip to content

Replace REST API request parameter "master_timeout" with "cluster_manager_timeout" in High Level REST Client when building requests #2928

@tlfeng

Description

@tlfeng

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:

In version 3.0 and above:

Describe alternatives you've considered
none.

Additional context
none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecateenhancementEnhancement or improvement to existing feature or requestv3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions