-
Notifications
You must be signed in to change notification settings - Fork 123
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
[2.0] Deprecate the "Master" nomenclature in nodejs client #222
Conversation
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.
should be bwc
will change to allow both |
Current test:
|
On cat.master
Result:
Check this API without nodejs client. It is working.
|
On client.nodes.info
Result:
This is expected. If API exist but cluster_manager_timeout/master paras does not exist: |
On client.cluster.health
Result:
|
Sorry my bad.
|
cat.master and cat.cluster_manager are both supported.
|
Other test results:
|
I would like to document some test steps:
|
[Research & Summary] [Optional master_timeout] —> What change:
—> How to Test: For example, client.nodes.info: Use script to test it:
Results are:
2.Both API and params exist Use script to test it:
Results are:
[API's request query string] Some APIs query params contains master_timeout. For example, cluster API:
For acceptedQuerystring, add —> Affected Files:
—> Example:
—> How to Test: [CAT.master API] —> Affected Files:
—> How to Test:
Results:
[NodeRole] NodeRole/NodeRoles are defined in api/types.d.ts. They are used in: 3.NodesInfoNodeInfo: Add 'cluster_manager' in NodeRole —> Affected Files: —> How to Test: [Connection role]
—> Affected Files: —> How to Test: [Optional initial_master_nodes] —> Affected Files: —> Example:
—> How to Test: [Optional master_node param] —> Affected Files: —> Example:
—> How to Test: [Optional master param] —> Affected Files: —> Example:
—> How to Test: |
@ananzh there ares some lint error's, can you fix them? |
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.
I had a few questions about the way the new roles were implemented, but those may be due to my lack of familiarity.
Where possible, I'd recommend just aliasing the old terminology and names to the new names, to avoid drift or divergence in the duplicated code paths.
roles: ['master', 'data', 'ingest'] | ||
roles: ['cluster_manager', 'data', 'ingest'] |
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.
Just a note - changing all the test roles in this file is actually removing test coverage for the master
role. Ideally, we should still test the deprecated role until we actually remove support for it.
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.
Yeah, so the purpose of changing some tests is to make sure both cluster_manager
and master
are working. Instead of writing very similar unit tests for these two roles, I decide to modify some current unit tests, especially if there are multiple nodes. Would like more discussion here.
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.
I think confirming that both options work the same is worthwhile in any of the tests that currently use master
.
done |
What's the upgrade path for users that have applications that work against OpenSearch 1.x and want to go to 2.x? Ideally 2.0 client would work against 1.x, see opensearch-project/opensearch-clients#17 |
I believe mentioned in the thread, assuming none of the new APIs are used it should ideally we work. But I know there was another issue about the source of truth for compatibility. It seems fairly easy to remember clients major versions only equal to the same major version of OpenSearch. I do see the RFC for API versioning which will also effect decisions here. I think for sure it should be standardized across all clients. |
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.
Some comments, but pulled it down in my OpenSearch Dashboards and didn't run into any issues (albeit didn't change any configurations).
Thanks for this!
Also seems like this file used for generating the API file https://github.com/opensearch-project/opensearch-js/blob/main/scripts/utils/patch.json and marking as deprecated. |
9c03f6f
to
d1478ec
Compare
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.
I think that instead of choosing some tests to replace master
, each of the test suites should confirm that both master
and the alternative behave the same way.
roles: ['master', 'data', 'ingest'] | ||
roles: ['cluster_manager', 'data', 'ingest'] |
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.
I think confirming that both options work the same is worthwhile in any of the tests that currently use master
.
1.Deprecate setting cluster.initial_master_nodes and introduce the alternative setting cluster.initial_cluster_manager_nodes. 2.Use a new node role cluster_manager that has the same functionality with master in the node setting node.roles: [ master ] 3.Cat API _cat/master is deprecated with _cat/cluster_manager 4.Deprecate master_timeout parameter to cluster_manager_timeout 5.Deprecate several interfaces, for example CatMasterMasterRecord 6.Replaces tests and comments Issue Resolved: opensearch-project#221 Signed-off-by: Anan Zhuang <[email protected]> add some comments and toDos for master deprecation Signed-off-by: Anan Zhuang <[email protected]> update TODO and use JSDoc Signed-off-by: Anan Zhuang <[email protected]>
0ae26de
to
95ee7a9
Compare
Signed-off-by: Anan Zhuang <[email protected]>
if ( | ||
(node.roles.cluster_manager === true || node.roles.master === true) && | ||
node.roles.data === false && | ||
node.roles.ingest === 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.
Do we have unit tests for this function?
Description
1.Deprecate setting cluster.initial_master_nodes and introduce
the alternative setting cluster.initial_cluster_manager_nodes.
2.Use a new node role cluster_manager that has the same functionality
with master in the node setting node.roles: [ master ]
3.Cat API _cat/master is replaced with _cat/cluster_manager
4.Deprecate master_timeout parameter to cluster_manager_timeout
5.Deprecate several interfaces, for example CatMasterMasterRecord
6.Replaces tests and comments
Issues Resolved
#221
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.