Add a new REST API endpoint 'GET _cat/cluster_manager' as the replacement of 'GET _cat/master'#2404
Conversation
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
|
Can one of the admins verify this patch? |
Signed-off-by: Tianli Feng <ftianli@amazon.com>
| public List<Route> routes() { | ||
| return singletonList(new Route(GET, "/_cat/master")); | ||
| public List<ReplacedRoute> replacedRoutes() { | ||
| return singletonList(new ReplacedRoute(GET, "/_cat/cluster_manager", "/_cat/master")); |
There was a problem hiding this comment.
Is the plan to support this old API forever?
Or is there a EOL defined after couple of major version releases?
There was a problem hiding this comment.
The "_cat/master" API will be removed in a future major version. Although the current plan is to remove in version 3.0, it depends on the users' acceptance.
There was a problem hiding this comment.
Thanks for your idea, I added a comment to indicate the deprecated API will be removed in the future.
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json
Show resolved
Hide resolved
rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json
Outdated
Show resolved
Hide resolved
| "type":"boolean", | ||
| "description":"Return local information, do not retrieve the state from master node (default: false)" | ||
| }, | ||
| "master_timeout":{ |
There was a problem hiding this comment.
Shouldn't this parameter name be changed to be inclusive?
There was a problem hiding this comment.
Hmmm, good question. I didn't think of it at that time. Since the deprecation of the parameter "master_timeout" will be handled in separate PR, maybe it is fair to keep it for now. 🙂
There was a problem hiding this comment.
I don't think we should introduce a new API with old parameter names. If a client moves to the _cat/cluster_manager API with this in place, they will continue to use the master_timeout parameter name. Then, when we deprecate the parameter, they will need to make another change to prevent breakage.
I would rather we use inclusive naming from the get-go in net-new APIs and code paths.
There was a problem hiding this comment.
I got it. 😄 Make sense not to introduce a new API with out-dated parameter name.
I realized that a new json file of rest-api-spec may not necessary, because the main code change I made is to give an alternative API path to _cat/master, but not adding a new API.
I will modify the code not to create a new json file of rest-api-spec, and find out a better way to deal with the API path change.
If that works, I will also modify the PR title and description, because the code change is not actually adding a new REST API.
There was a problem hiding this comment.
I modified the code to:
- Rename the current JSON rest-api-spec file
cat.master.jsontocat.cluster_manager.json - Add path
_cat/cluster_managerand_cat/masterpath as the deprecated path - Test both old and new path in one YAML file to test the both REST API path
If I should deprecate the request parameter master_timeout, I will make the code change after the PR #2435 merged, because that PR will add the method to validate whether the value of master_timeout and cluster_manager_timeout is equal, and also set a sample for all the master_timeout deprecation.
There was a problem hiding this comment.
👍 please add an issue so we don't miss out on it
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
|
In log 3435: This is caused by Lucene 9 upgrade, and is tracked in issue #2063 (comment) |
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Signed-off-by: Tianli Feng <ftianli@amazon.com>
| @@ -50,18 +50,19 @@ | |||
| public class RestMasterAction extends AbstractCatAction { | |||
There was a problem hiding this comment.
Such class name won't be considered as inclusive?
There was a problem hiding this comment.
Hi @owaiskazi19, thanks for your review! The RestMasterAction class is published to maven as Java API (https://opensearch.org/javadocs/1.2.4/OpenSearch/server/build/docs/javadoc/org/opensearch/rest/action/cat/RestMasterAction.html). I didn't plan to rename them in 2.0 version, in case giving clients or plugins which use such classes too much work in upgrading to support 2.0 version. 😄
There is a discussion in the PR #2453, you could take a look at. Renaming the Java APIs is tracked in issue #1684
There was a problem hiding this comment.
Sounds good. Thanks for clearing it.
Signed-off-by: Tianli Feng <ftianli@amazon.com>
Description
Add a new REST API endpoint
GET _cat/cluster_manager, as alternative of the existingGET _cat/master/_cat/cluster_managerfor the REST request handlerRestMasterAction/_cat/masterRestMasterActionhandler fromcat_master_actiontocat_cluster_manager_actionGET _catto only show the new path/_cat/cluster_managercat.master.jsontocat.cluster_manager.jsonand update the paths.GET _cat/cluster_managerandGET _cat/masterCurrent API response of "GET _cat"
Proposed API response of "GET _cat"
Testing
running YAML REST test
Issues Resolved
Part of #1549
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.