-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 'cluster_manager' role attachment when using 'node.master' deprecated setting #6331
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
At first glance, adding the cluster manager role when node.master is true seems wrong. |
5bf7962
to
e16a4f7
Compare
Gradle Check (Jenkins) Run Completed with:
|
e16a4f7
to
74b94ca
Compare
Gradle Check (Jenkins) Run Completed with:
|
Thanks @andrross for providing feedback. I appreciate the ideation of keeping the deprecated legacy settings to be restricted to deprecated roles, in terms of selection of Here is the new response from
The tests added validate node roles and cluster stats response I still want to point that the legacy settings: when you provide a combination of When setting up explicit roles - |
Gradle Check (Jenkins) Run Completed with:
|
@@ -322,4 +323,81 @@ public void testFieldTypes() { | |||
} | |||
} | |||
} | |||
|
|||
public void testNodeCountsWithLegacyMasterSetting() throws ExecutionException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add test with cluster manager role as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shwetathareja for checking. Added some tests and refactored some.
Gradle Check (Jenkins) Run Completed with:
|
@@ -273,6 +274,10 @@ public void validateRole(List<DiscoveryNodeRole> roles) { | |||
} | |||
} | |||
|
|||
@Override | |||
public boolean isEnabledByDefault(final Settings settings) { | |||
return !Booleans.isBoolean(settings.get("node.master")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, the the prevailing style is Booleans.isBoolean(settings.get("node.master")) == false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing @andrross! Addressed the comment and re-based my changes against main to resolve conflicts in CHANGELOG.md
…ovided Signed-off-by: Sandesh Kumar <[email protected]> Remove 'node.master' legacy setting from 'cluster_manager' role Signed-off-by: Sandesh Kumar <[email protected]> Typo in test Signed-off-by: Sandesh Kumar <[email protected]> Add tests with node.roles for cluster manager Signed-off-by: Sandesh Kumar <[email protected]> minor refactoring with specifying node roles Signed-off-by: Sandesh Kumar <[email protected]> Revert "minor refactoring with specifying node roles" This reverts commit c9c123e. Signed-off-by: Sandesh Kumar <[email protected]> minor refactoring with specifying node roles Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
Signed-off-by: Sandesh Kumar <[email protected]>
10493ee
to
b7cda75
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sandesh Kumar <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sandesh Kumar <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
…recated setting (#6331) `cluster_manager` role no longer configures the legacy `node.master` setting. Using `node.master: true` configures both cluster_manager and master role to a node which is not correct, only one of them should be assigned Allowing only one of the both roles to be attached instead of both - 'master' which is deprecated - since both the legacy setting `node.master` and `master` role are deprecated - so we need to keep the initial behavior only with deprecated roles and settings. Signed-off-by: Sandesh Kumar <[email protected]> (cherry picked from commit 5f89081) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…recated setting (#6331) (#6853) `cluster_manager` role no longer configures the legacy `node.master` setting. Using `node.master: true` configures both cluster_manager and master role to a node which is not correct, only one of them should be assigned Allowing only one of the both roles to be attached instead of both - 'master' which is deprecated - since both the legacy setting `node.master` and `master` role are deprecated - so we need to keep the initial behavior only with deprecated roles and settings. (cherry picked from commit 5f89081) Signed-off-by: Sandesh Kumar <[email protected]>
…recated setting (opensearch-project#6331) `cluster_manager` role no longer configures the legacy `node.master` setting. Using `node.master: true` configures both cluster_manager and master role to a node which is not correct, only one of them should be assigned Allowing only one of the both roles to be attached instead of both - 'master' which is deprecated - since both the legacy setting `node.master` and `master` role are deprecated - so we need to keep the initial behavior only with deprecated roles and settings. Signed-off-by: Sandesh Kumar <[email protected]> Signed-off-by: Valentin Mitrofanov <[email protected]>
Description
Using
node.master: true
configures bothcluster_manager
andmaster
role to a node which is not correct, only one of them should be assigned.Reference in cdk where it uses legacy settings to bootstrap nodes: https://github.com/opensearch-project/opensearch-cluster-cdk/blob/main/lib/opensearch-config/multi-node-base-config.yml
Allowing only one of the both roles to be attached instead of both - 'master' which is deprecated as part of change of 'master' nomenclature: #472 - since both the legacy setting
node.master
andmaster
role are deprecated - so we need to keep the initial behavior only with deprecated roles and settings.Issues Resolved
Resolves #6103
The change modifies the role attached in multi-node dedicated cluster-manager setup.
API response before the change:
Multi node with dedicated cluster-manager when bootstrapped with
node.master: true
:API response after the change:
Multi node with dedicated cluster-manager when bootstrapped with
node.master: true
: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.