-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add alternative usages for the REST APIs and configurations that contain "master" terminology #1549
Description
Is your feature request related to a problem? Please describe.
Replace "master" terminology in REST APIs and configurations, where the backwards compatibility will be impacted.
A part of #472
Describe the solution you'd like
- Replace the old usages that having the word "master" with "cluster manager" in REST APIs and configurations, then create duplicate usages with the original name for backwards compatibility (including fallback logic to fallback to settings with the new name).
- Add tests to check both old and new usages of the REST APIs and configurations.
- Add proper deprecation notice to the old usages.
Sub-tasks:
Setting name:
- Deprecate setting
cluster.initial_master_nodesand introduce the alternative settingcluster.initial_cluster_manager_nodes. (PR: Deprecate setting 'cluster.initial_master_nodes' and introduce the alternative setting 'cluster.initial_cluster_manager_nodes' #2463) - Deprecate setting
cluster.service.slow_master_task_logging_thresholdand introduce the alternative setting .cluster.service.slow_cluster_manager_task_logging_threshold. (PR: Deprecate setting 'cluster.service.slow_master_task_logging_threshold' and introduce the alternative setting 'cluster.service.slow_cluster_manager_task_logging_threshold' #2451) - Deprecate setting
cluster.no_master_blockand introduce the alternative settingcluster.no_cluster_manager_block. (PR: Deprecate setting 'cluster.no_master_block' and introduce the alternative setting 'cluster.no_cluster_manager_block' #2453)
Setting value:
- Add a new node role
cluster_managerthat has the same functionality withmasterin the node settingnode.roles: [ master ](PR: Add a new node role 'cluster_manager' as the alternative for 'master' role and deprecate 'master' role #2424)
REST API endpoint:
- Add a new REST API
GET _cat/cluster_manageras the replacement ofGET _cat/master(PR: Add a new REST API endpoint 'GET _cat/cluster_manager' as the replacement of 'GET _cat/master' #2404)
REST API path parameter:
- Make the "node filters" <node_id> used as the request parameter for some REST API accept values with "cluster_manager" as an alternative to "master" (PR: Add a new node role 'cluster_manager' as the alternative for 'master' role and deprecate 'master' role #2424)
REST API request parameter name:
- Add a new request parameter "cluster_manager_timeout" in the REST APIs that accept "master_timeout" parameter, and deprecate "master_timeout" (Issue: Add a new request parameter "cluster_manager_timeout" in the REST APIs that accept "master_timeout" parameter, and deprecate "master_timeout" #2511)
-
- CAT Nodes API - this will be a sample (PR: Add request parameter 'cluster_manager_timeout' as the alternative for 'master_timeout', and deprecate 'master_timeout' - in CAT Nodes API #2435)
- See below for the full list of impacted REST APIs
REST API request parameter value:
- Make the request parameter "metric" in "Cluster reroute" and "Cluster state" API accept value "cluster_manager_node" as an alternative to "master_node" (PR: Add 'cluster_manager_node' into ClusterState Metric as an alternative to 'master_node' #2415)
REST API response field:
- Add a new field "discovered_cluster_manager" in the response of
GET _cluster/healthAPI that shows identical value of field "discovered_master" (PR: Add a field 'discovered_cluster_manager' in 'GET Cluster Health' API that shows identical value with field 'discovered_master' #2437) - Replace the "discovered_master" with "discovered_cluster_manager" in the response of
GET _cat/healthAPI (PR: Replace 'discovered_master' with 'discovered_cluster_manager' in 'GET Cat Health' API #2438) - Replace the "master" with "cluster_manager" in the response of
GET _cat/nodesAPI (PR: Replace 'master' with 'cluster_manager' in 'GET Cat Nodes' API #2441)
Describe alternatives you've considered
None.
Additional context
Location that contains the exclusionary term and will impact the compatibility when changed:
Setting names
1 Discovery and cluster formation settings
cluster.initial_master_nodes (static)
cluster.no_master_block (dynamic)
discovery.zen.no_master_block
discovery.zen.minimum_master_nodes
discovery.zen.master_election.*
Note: discovery.zen.* settings are already deprecated in Elasticsearch 7.0, but code remains to be removed. Update: they have been removed in OpenSearch 2.0 by the commit 4db97aa
2 Local gateway settings
gateway.expected_master_nodes
gateway.recover_after_master_nodes
Note: the above 2 settings are already deprecated in Elasticsearch 7.7, but code remains to be removed.
3 Miscellaneous
cluster.service.slow_master_task_logging_threshold (dynamic)
Code: https://github.com/opensearch-project/OpenSearch/blob/1.0.0/server/src/main/java/org/opensearch/cluster/service/MasterService.java#L90
Setting values
1 Node roles
node.roles: [ master ] (static)
REST API endpoints
1 cat master
GET _cat/master
REST API path parameters
1 "node filters" used in some cluster-level APIs. The APIs are usually in the format: GET /_nodes/<node_id>, where <node_id> can be set as _master or master:true or master:false to filter the master nodes.
Nodes Info API API - GET /_nodes/<node_id>
Nodes stats API - GET /_nodes/<node_id>/stats , GET/_nodes/<node_id>/stats/<metric> , GET /_nodes/<node_id>/stats/<metric>/<index_metric>
Nodes feature usage API - GET /_nodes/<node_id>/usage , GET /_nodes/<node_id>/usage/<metric>
Nodes hot threads API - GET /_nodes/<node_id>/hot_threads
Nodes reload secure settings API - POST /_nodes/<node_id>/reload_secure_settings
Task management API - GET _tasks?nodes=<node_id>
REST API request parameter names
1 master_timeout (used in multiple APIs)
- In CAT API:
CAT Allocation API https://opensearch.org/docs/opensearch/rest-api/cat/cat-allocation/
CAT Indices API https://opensearch.org/docs/opensearch/rest-api/cat/cat-indices/
CAT Master API https://opensearch.org/docs/opensearch/rest-api/cat/cat-master/
CAT Nodeattrs API https://opensearch.org/docs/opensearch/rest-api/cat/cat-nodeattrs/
CAT Nodes API https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-nodes/
CAT Pending tasks API https://opensearch.org/docs/opensearch/rest-api/cat/cat-pending-tasks/
CAT Plugins API https://opensearch.org/docs/opensearch/rest-api/cat/cat-plugins/
CAT Repositories API https://opensearch.org/docs/opensearch/rest-api/cat/cat-repositories/
CAT Shards API https://opensearch.org/docs/opensearch/rest-api/cat/cat-shards/
CAT Snapshots API https://opensearch.org/docs/opensearch/rest-api/cat/cat-snapshots/
CAT Templates API https://opensearch.org/docs/opensearch/rest-api/cat/cat-templates/
CAT Thread pool API https://opensearch.org/docs/opensearch/rest-api/cat/cat-thread-pool/
CAT Segment API https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - In Cluster API:
Cluster health API https://opensearch.org/docs/opensearch/rest-api/cluster-health/
Cluster reroute API -POST /_cluster/reroute
Cluster state API -GET /_cluster/state/<metrics>/<target>
Cluster get settings API https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/
Cluster update settings API https://opensearch.org/docs/latest/opensearch/rest-api/cluster-settings/
Pending cluster tasks API -GET /_cluster/pending_tasks - In Index API:
Index management:
Create index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/
Delete index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/
Get index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/
Open index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/open-index/
Close index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/
Clone index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/
Shrink index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/
Split index API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/
Rollover index APIPOST /<rollover-target>/_rollover/<target-index>
Alias management:
Add index alias API https://opensearch.org/docs/latest/opensearch/rest-api/alias/
Delete index alias APIDELETE /<index>/_alias/<alias>
Mapping management:
Get mapping API
Put mapping API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/put-mapping/
Index settings:
Get Index Settings API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-settings/
Update index settings API https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/update-settings/
Index templates:
Get (Legacy) Index Template APIGET /_template/<index-template>
Delete (Legacy) Index Template APIDELETE /_template/<index-template>
Put (Legacy) Index Template APIPUT /_template/<index-template>
Get (Composable) Index Template APIGET /_index_template/<index-template>
Delete (Composable) Index Template API
Put (Composable) Index Template API
Get Component Template APIGET /_component_template/<index-template>
Delete Component Template API
Put Component Template API
Simulate index APIPOST /_index_template/_simulate_index/{name}
Simulate index template APIPOST /_index_template/_simulate
Dangling indices:
Delete Dangling Index API
Import Dangling Index APIPOST /_dangling/<index-uuid>
Other:
Add index block APIPUT /<index>/_block/<block> - In Snapshot API:
Put snapshot repository APIPUT /_snapshot/<repository>,POST /_snapshot/<repository>
Get snapshot repository API
Delete snapshot repository API
Clean up snapshot repository APIPOST /_snapshot/<repository>/_cleanup
Verify snapshot repository APIPOST /_snapshot/<repository>/_verify
Create snapshot API
Get snapshot API
Delete snapshot API
Restore snapshot APIPOST /_snapshot/<repository>/<snapshot>/_restore
Clone snapshot API
Get snapshot status APIGET _snapshot/<repository>/<snapshot>/_status - In Ingest API:
Put pipeline API https://opensearch.org/docs/latest/opensearch/rest-api/ingest-apis/create-update-ingest/
Get pipeline API https://opensearch.org/docs/latest/opensearch/rest-api/ingest-apis/get-ingest/
Delete pipeline API https://opensearch.org/docs/latest/opensearch/rest-api/ingest-apis/delete-ingest/ - In Script API:
Get stored script APIGET _scripts/<script-id>
Put stored script API
Delete stored script API
REST API request parameter values
1 metric=master_node
Cluster reroute API - POST /_cluster/reroute
Cluster state API - GET /_cluster/state/<metrics>/<target>
REST API response fields
1 discovered_master
Response of GET _cluster/health
doc: https://opensearch.org/docs/latest/opensearch/rest-api/cluster-health/#response
code: https://github.com/opensearch-project/OpenSearch/blob/1.1.0/server/src/main/java/org/opensearch/action/admin/cluster/health/ClusterHealthResponse.java#L69
Response of GET _cat/health (in the header of table)
doc: https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-health/#response
code: https://github.com/opensearch-project/OpenSearch/blob/1.2.4/server/src/main/java/org/opensearch/rest/action/cat/RestHealthAction.java#L91
2 cat nodes
Response of GET _cat/nodes
The guide for plugins can be a reference: https://github.com/opensearch-project/opensearch-plugins/blob/ece53bf9e93403272726eb6087ed98f9c821502b/UPGRADING.md#settings