Skip to content

Rename reserved node id '_must_join_elected_master_' to '_must_join_elected_cluster_manager_' that used by in DetachClusterCommand#3116

Merged
tlfeng merged 2 commits intoopensearch-project:mainfrom
tlfeng:rename-must-join-elected-master
May 3, 2022
Merged

Rename reserved node id '_must_join_elected_master_' to '_must_join_elected_cluster_manager_' that used by in DetachClusterCommand#3116
tlfeng merged 2 commits intoopensearch-project:mainfrom
tlfeng:rename-must-join-elected-master

Conversation

@tlfeng
Copy link
Copy Markdown
Contributor

@tlfeng tlfeng commented Apr 29, 2022

Description

To support inclusive language, replace "master" with "cluster manager".

  • Replace public field MUST_JOIN_ELECTED_MASTER with MUST_JOIN_ELECTED_CLUSTER_MANAGER in VotingConfiguration class
  • Rename the preserved node id _must_join_elected_master_ to _must_join_elected_cluster_manager_

The original _must_join_elected_master_ is only used as a preserved node id for "Detach Cluster Command" (https://github.com/opensearch-project/OpenSearch/blob/1.3.1/server/src/main/java/org/opensearch/cluster/coordination/DetachClusterCommand.java#L89).
"Detach Cluster Command" ./bin/opensearch-node detach-cluster can detach a node from its cluster by resetting its cluster UUID. The node can then join another cluster with a different UUID. _must_join_elected_master_ is set as a node id and used as an identifier for the node processed by "Detach Cluster Command".
Reference: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/node-tool.html#node-tool-detach-cluster

Issues Resolved

A part of #1548 , #1684

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

…lected_cluster_manager_' that used by in DetachClusterCommand

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@tlfeng tlfeng added v2.1.0 Issues and PRs related to version 2.1.0 backport 2.x Backport to 2.x branch labels Apr 29, 2022
@opensearch-ci-bot
Copy link
Copy Markdown
Collaborator

❌   Gradle Check failure 43e6389
Log 4872

Reports 4872

Signed-off-by: Tianli Feng <ftianli@amazon.com>
@opensearch-ci-bot
Copy link
Copy Markdown
Collaborator

✅   Gradle Check success 01b9d94
Log 4887

Reports 4887

@tlfeng tlfeng added v3.0.0 Issues and PRs related to version 3.0.0 and removed v2.1.0 Issues and PRs related to version 2.1.0 backport 2.x Backport to 2.x branch labels May 2, 2022
@tlfeng tlfeng marked this pull request as ready for review May 2, 2022 05:43
@tlfeng tlfeng requested review from a team and reta as code owners May 2, 2022 05:43
public static final VotingConfiguration MUST_JOIN_ELECTED_MASTER = new VotingConfiguration(
Collections.singleton("_must_join_elected_master_")
public static final VotingConfiguration MUST_JOIN_ELECTED_CLUSTER_MANAGER = new VotingConfiguration(
Collections.singleton("_must_join_elected_cluster_manager_")
Copy link
Copy Markdown
Member

@dblock dblock May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this name is never used in a distributed manner where 1 node calls it _must_join_elected_cluster_manager_ and the other _must_join_elected_master_ and it's ok?

Copy link
Copy Markdown
Contributor Author

@tlfeng tlfeng May 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dblock , thanks for your review!
In my opinion, the preserved node id _must_join_elected_master_ is only read by ClusterFormationFailureHelper, which result a line of log generated. The log says "master not discovered yet and this node was detached from its previous cluster", so it looks like not used in a distributed manner.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, to make it safe, it's better for me to deprecate MUST_JOIN_ELECTED_MASTER first in version 2.x, and accepting the both _must_join_elected_cluster_manager_ and _must_join_elected_master_ in ClusterFormationFailureHelper.
Otherwise, maybe doing a rolling upgrade from 2.x to 3.x after running ./bin/opensearch-node detach-cluster will be a problem to identify the old identifier _must_join_elected_master_. Thank you! 😄

@tlfeng tlfeng merged commit f58d98d into opensearch-project:main May 3, 2022
@tlfeng tlfeng deleted the rename-must-join-elected-master branch May 3, 2022 03:23
@tlfeng
Copy link
Copy Markdown
Contributor Author

tlfeng commented May 3, 2022

Created backport PR #3138 to deprecate VotingConfiguration.MUST_JOIN_ELECTED_MASTER in 2.x version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.0.0 Issues and PRs related to version 3.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants