Skip to content
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

Recover MasterEligible #38

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/OpenSearch.Net.VirtualizedCluster/VirtualCluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public VirtualCluster ClusterManagerEligible(params int[] ports)
return this;
}

[Obsolete("Use ClusterManagerEligible instead", false)]
public VirtualCluster MasterEligible(params int[] ports)
{
return ClusterManagerEligible(ports);
}

public VirtualCluster StoresNoData(params int[] ports)
{
foreach (var node in _nodes.Where(n => ports.Contains(n.Uri.Port)))
Expand Down
7 changes: 7 additions & 0 deletions src/OpenSearch.Net/ConnectionPool/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,15 @@ public Node(Uri uri)
/// <summary>Indicates whether this node is cluster_manager eligible, defaults to true when unknown/unspecified</summary>
public bool ClusterManagerEligible { get; set; }

/// <summary> Renamed to <see cref="ClusterManagerEligible"/> as of OpenSearch 2.0</summary>
[Obsolete("Use ClusterManagerEligible instead", false)]
public bool MasterEligible { get => ClusterManagerEligible; set => ClusterManagerEligible = value; }

public bool ClusterManagerOnlyNode => ClusterManagerEligible && !HoldsData;

[Obsolete("Use ClusterManagerOnlyNode instead", false)]
public bool MasterOnlyNode => ClusterManagerOnlyNode;

/// <summary>The name of the node, defaults to null when unknown/unspecified</summary>
public string Name { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions src/OpenSearch.Net/Responses/Sniff/SniffResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ internal bool HttpEnabled
internal bool IngestEnabled => roles?.Contains("ingest") ?? false;

internal bool ClusterManagerEligible => (roles == null ? false : roles.Contains("master") || roles.Contains("cluster_manager"));
[Obsolete("Use ClusterManagerEligible instead", false)]
internal bool MasterEligible => ClusterManagerEligible;
}

internal class NodeInfoHttp
Expand Down