Skip to content

Commit

Permalink
Correct mistakes
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Apr 26, 2022
1 parent d5660fd commit e6c10f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public static Predicate<ClusterState> build(ClusterState currentState) {
final DiscoveryNode clusterManagerNode = currentState.nodes().getMasterNode();
final String currentMasterId = clusterManagerNode == null ? null : clusterManagerNode.getEphemeralId();
return newState -> {
final DiscoveryNode newMaster = newState.nodes().getMasterNode();
final DiscoveryNode newClusterManager = newState.nodes().getMasterNode();
final boolean accept;
if (newMaster == null) {
if (newClusterManager == null) {
accept = false;
} else if (newMaster.getEphemeralId().equals(currentMasterId) == false) {
} else if (newClusterManager.getEphemeralId().equals(currentMasterId) == false) {
accept = true;
} else {
accept = newState.version() > currentVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ public void updateShardState(
* in one state causing it's term to be incremented. Note that if both current shard state and new
* shard state are initializing, we could replace the current shard and reinitialize it. It is however
* possible that this shard is being started. This can happen if:
* 1) Shard is post recovery and sends shard started to the mcluster-manager
* 1) Shard is post recovery and sends shard started to the cluster-manager
* 2) Node gets disconnected and rejoins
* 3) Cluster-manager assigns the shard back to the node
* 4) Cluster-manager processes the shard started and starts the shard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private void updateFailedShardsCache(final ClusterState state) {
} else {
// TODO: can we remove this? Is resending shard failures the responsibility of shardStateAction?
if (clusterManagerNode != null) {
String message = "master " + clusterManagerNode + " has not removed previously failed shard. resending shard failure";
String message = "cluster-manager " + clusterManagerNode + " has not removed previously failed shard. resending shard failure";
logger.trace("[{}] re-sending failed shard [{}], reason [{}]", matchedRouting.shardId(), matchedRouting, message);
shardStateAction.localShardFailed(matchedRouting, message, null, SHARD_STATE_ACTION_LISTENER, state);
}
Expand Down
6 changes: 3 additions & 3 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public class Node implements Closeable {
Property.Deprecated,
Property.NodeScope
);
private static final Setting<Boolean> NODE_CLUSTER_MANAGER_SETTING = Setting.boolSetting(
private static final Setting<Boolean> NODE_MASTER_SETTING = Setting.boolSetting(
"node.master",
true,
Property.Deprecated,
Expand All @@ -256,7 +256,7 @@ public class Node implements Closeable {
* controls whether the node is allowed to persist things like metadata to disk
* Note that this does not control whether the node stores actual indices (see
* {@link #NODE_DATA_SETTING}). However, if this is false, {@link #NODE_DATA_SETTING}
* and {@link #NODE_CLUSTER_MANAGER_SETTING} must also be false.
* and {@link #NODE_MASTER_SETTING} must also be false.
*
*/
public static final Setting<Boolean> NODE_LOCAL_STORAGE_SETTING = Setting.boolSetting(
Expand Down Expand Up @@ -445,7 +445,7 @@ protected Node(
// register the node.data, node.ingest, node.master, node.remote_cluster_client settings here so we can mark them private
additionalSettings.add(NODE_DATA_SETTING);
additionalSettings.add(NODE_INGEST_SETTING);
additionalSettings.add(NODE_CLUSTER_MANAGER_SETTING);
additionalSettings.add(NODE_MASTER_SETTING);
additionalSettings.add(NODE_REMOTE_CLUSTER_CLIENT);
additionalSettings.addAll(pluginsService.getPluginSettings());
final List<String> additionalSettingsFilter = new ArrayList<>(pluginsService.getPluginSettingsFilter());
Expand Down

0 comments on commit e6c10f2

Please sign in to comment.