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

Add a field 'discovered_cluster_manager' in 'GET Cluster Health' API that shows identical value with field 'discovered_master' #2437

Merged
merged 4 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,16 @@
cluster.health:
index: index-2
- match: { status: yellow }

---
"Get cluster health has same value for discovered_master and discovered_cluster_manager":
- skip:
version: " - 1.4.99"
reason: "discovered_cluster_manager is added in 2.0.0"
- do:
cluster.health: {}
- set:
discovered_master: discovered_or_not

- match: { discovered_master: $discovered_or_not }
- match: { discovered_cluster_manager: $discovered_or_not }
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public class ClusterHealthResponse extends ActionResponse implements StatusToXCo
private static final String NUMBER_OF_NODES = "number_of_nodes";
private static final String NUMBER_OF_DATA_NODES = "number_of_data_nodes";
private static final String DISCOVERED_MASTER = "discovered_master";
private static final String DISCOVERED_CLUSTER_MANAGER = "discovered_cluster_manager";
private static final String NUMBER_OF_PENDING_TASKS = "number_of_pending_tasks";
private static final String NUMBER_OF_IN_FLIGHT_FETCH = "number_of_in_flight_fetch";
private static final String DELAYED_UNASSIGNED_SHARDS = "delayed_unassigned_shards";
Expand Down Expand Up @@ -376,7 +377,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.field(TIMED_OUT, isTimedOut());
builder.field(NUMBER_OF_NODES, getNumberOfNodes());
builder.field(NUMBER_OF_DATA_NODES, getNumberOfDataNodes());
builder.field(DISCOVERED_MASTER, hasDiscoveredMaster());
builder.field(DISCOVERED_MASTER, hasDiscoveredMaster()); // the field will be removed in a future major version
builder.field(DISCOVERED_CLUSTER_MANAGER, hasDiscoveredMaster());
builder.field(ACTIVE_PRIMARY_SHARDS, getActivePrimaryShards());
builder.field(ACTIVE_SHARDS, getActiveShards());
builder.field(RELOCATING_SHARDS, getRelocatingShards());
Expand Down