[Refactor] Not load the deprecated node role 'master' in method 'setAdditionalRoles()' which used to load roles defined by plugins #4579
Labels
distributed framework
enhancement
Enhancement or improvement to existing feature or request
v2.4.0
'Issues and PRs related to version v2.4.0'
Is your feature request related to a problem? Please describe.
It doesn't look like suitable to load a core node role
master
as "additonal roles".In commit ea31483 / PR #2424, node role 'master' is deprecated, and the alternative role 'cluster_manager' is added.
Since the role 'cluster_manager' is the successor for 'master', the same abbreviation role name 'm' is set to the new role for convenience.
While there is a check to ensure the abbreviation names for node roles are unique:
OpenSearch/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java
Lines 608 to 614 in 1510b94
As a workaround, I added the deprecated node role 'master' after the check, in the method
setAdditionalRoles()
which used to load roles defined by plugins, instead ofBUILT_IN_ROLES
:OpenSearch/server/src/main/java/org/opensearch/cluster/node/DiscoveryNodeRole.java
Line 296 in e9c5ce3
OpenSearch/server/src/main/java/org/opensearch/cluster/node/DiscoveryNode.java
Line 603 in 1510b94
OpenSearch/server/src/main/java/org/opensearch/node/Node.java
Line 425 in 19d1a2b
Describe the solution you'd like
Load the deprecated
master
role in other places, but not in methodsetAdditionalRoles()
Describe alternatives you've considered
It's fine to keep as it is, because the current code of setting 'master' role is a temporary workaround and will be removed in the next major version.
Additional context
The text was updated successfully, but these errors were encountered: