Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Security Manager Replacement] Create initial Java Agent to intercept Socket::connect calls ([#17724](https://github.com/opensearch-project/OpenSearch/pull/17724))
- Add ingestion management APIs for pause, resume and get ingestion state ([#17631](https://github.com/opensearch-project/OpenSearch/pull/17631))
- [Security Manager Replacement] Enhance Java Agent to intercept System::exit ([#17746](https://github.com/opensearch-project/OpenSearch/pull/17746))
- Include search replica in _cat/indices response ([#17756](https://github.com/opensearch-project/OpenSearch/pull/17756))

### Changed
- Migrate BC libs to their FIPS counterparts ([#14912](https://github.com/opensearch-project/OpenSearch/pull/14912))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down Expand Up @@ -124,6 +125,7 @@
index-2 \s+
([a-zA-Z0-9=/_+]|[\\\-]){22} \s+
3 \s+
0 \s+
0 \s+
\s+
\s+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down Expand Up @@ -71,6 +72,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down Expand Up @@ -116,6 +118,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand All @@ -134,6 +137,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down Expand Up @@ -176,6 +180,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand All @@ -194,6 +199,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down Expand Up @@ -234,6 +240,7 @@
0 \s+
0 \s+
0 \s+
0 \s+
(\d+|\d+[.]\d+)(kb|b) \s+
(\d+|\d+[.]\d+)(kb|b) \s*
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

package org.opensearch.cluster.health;

import org.opensearch.Version;
import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.routing.IndexRoutingTable;
Expand Down Expand Up @@ -71,6 +72,7 @@ public final class ClusterIndexHealth implements Iterable<ClusterShardHealth>, W
private static final String STATUS = "status";
private static final String NUMBER_OF_SHARDS = "number_of_shards";
private static final String NUMBER_OF_REPLICAS = "number_of_replicas";
private static final String NUMBER_OF_SEARCH_REPLICAS = "number_of_search_replicas";
private static final String ACTIVE_PRIMARY_SHARDS = "active_primary_shards";
private static final String ACTIVE_SHARDS = "active_shards";
private static final String RELOCATING_SHARDS = "relocating_shards";
Expand All @@ -85,6 +87,7 @@ public final class ClusterIndexHealth implements Iterable<ClusterShardHealth>, W
int i = 0;
int numberOfShards = (int) parsedObjects[i++];
int numberOfReplicas = (int) parsedObjects[i++];
int numberOfSearchReplicas = (int) parsedObjects[i++];
int activeShards = (int) parsedObjects[i++];
int relocatingShards = (int) parsedObjects[i++];
int initializingShards = (int) parsedObjects[i++];
Expand All @@ -107,6 +110,7 @@ public final class ClusterIndexHealth implements Iterable<ClusterShardHealth>, W
index,
numberOfShards,
numberOfReplicas,
numberOfSearchReplicas,
activeShards,
relocatingShards,
initializingShards,
Expand All @@ -126,6 +130,7 @@ public final class ClusterIndexHealth implements Iterable<ClusterShardHealth>, W
static {
PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_SHARDS));
PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_REPLICAS));
PARSER.declareInt(constructorArg(), new ParseField(NUMBER_OF_SEARCH_REPLICAS));
PARSER.declareInt(constructorArg(), new ParseField(ACTIVE_SHARDS));
PARSER.declareInt(constructorArg(), new ParseField(RELOCATING_SHARDS));
PARSER.declareInt(constructorArg(), new ParseField(INITIALIZING_SHARDS));
Expand All @@ -139,6 +144,7 @@ public final class ClusterIndexHealth implements Iterable<ClusterShardHealth>, W
private final String index;
private final int numberOfShards;
private final int numberOfReplicas;
private final int numberOfSearchReplicas;
private final int activeShards;
private final int relocatingShards;
private final int initializingShards;
Expand All @@ -152,6 +158,7 @@ public ClusterIndexHealth(final IndexMetadata indexMetadata, final IndexRoutingT
this.index = indexMetadata.getIndex().getName();
this.numberOfShards = indexMetadata.getNumberOfShards();
this.numberOfReplicas = indexMetadata.getNumberOfReplicas();
this.numberOfSearchReplicas = indexMetadata.getNumberOfSearchOnlyReplicas();

shards = new HashMap<>();
for (IndexShardRoutingTable shardRoutingTable : indexRoutingTable) {
Expand Down Expand Up @@ -200,6 +207,7 @@ public ClusterIndexHealth(
this.index = indexMetadata.getIndex().getName();
this.numberOfShards = indexMetadata.getNumberOfShards();
this.numberOfReplicas = indexMetadata.getNumberOfReplicas();
this.numberOfSearchReplicas = indexMetadata.getNumberOfSearchOnlyReplicas();

shards = new HashMap<>();

Expand Down Expand Up @@ -299,6 +307,11 @@ public ClusterIndexHealth(final StreamInput in) throws IOException {
index = in.readString();
numberOfShards = in.readVInt();
numberOfReplicas = in.readVInt();
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
numberOfSearchReplicas = in.readVInt();
} else {
numberOfSearchReplicas = 0;
}
activePrimaryShards = in.readVInt();
activeShards = in.readVInt();
relocatingShards = in.readVInt();
Expand All @@ -321,6 +334,7 @@ public ClusterIndexHealth(final StreamInput in) throws IOException {
String index,
int numberOfShards,
int numberOfReplicas,
int numberOfSearchReplicas,
int activeShards,
int relocatingShards,
int initializingShards,
Expand All @@ -332,6 +346,7 @@ public ClusterIndexHealth(final StreamInput in) throws IOException {
this.index = index;
this.numberOfShards = numberOfShards;
this.numberOfReplicas = numberOfReplicas;
this.numberOfSearchReplicas = numberOfSearchReplicas;
this.activeShards = activeShards;
this.relocatingShards = relocatingShards;
this.initializingShards = initializingShards;
Expand All @@ -353,6 +368,10 @@ public int getNumberOfReplicas() {
return numberOfReplicas;
}

public int getNumberOfSearchReplicas() {
return numberOfSearchReplicas;
}

public int getActiveShards() {
return activeShards;
}
Expand Down Expand Up @@ -395,6 +414,9 @@ public void writeTo(final StreamOutput out) throws IOException {
out.writeString(index);
out.writeVInt(numberOfShards);
out.writeVInt(numberOfReplicas);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeVInt(numberOfSearchReplicas);
}
out.writeVInt(activePrimaryShards);
out.writeVInt(activeShards);
out.writeVInt(relocatingShards);
Expand All @@ -410,6 +432,7 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa
builder.field(STATUS, getStatus().name().toLowerCase(Locale.ROOT));
builder.field(NUMBER_OF_SHARDS, getNumberOfShards());
builder.field(NUMBER_OF_REPLICAS, getNumberOfReplicas());
builder.field(NUMBER_OF_SEARCH_REPLICAS, getNumberOfSearchReplicas());
builder.field(ACTIVE_PRIMARY_SHARDS, getActivePrimaryShards());
builder.field(ACTIVE_SHARDS, getActiveShards());
builder.field(RELOCATING_SHARDS, getRelocatingShards());
Expand Down Expand Up @@ -451,6 +474,8 @@ public String toString() {
+ numberOfShards
+ ", numberOfReplicas="
+ numberOfReplicas
+ ", numberOfSearchReplicas="
+ numberOfSearchReplicas
+ ", activeShards="
+ activeShards
+ ", relocatingShards="
Expand All @@ -476,6 +501,7 @@ public boolean equals(Object o) {
return Objects.equals(index, that.index)
&& numberOfShards == that.numberOfShards
&& numberOfReplicas == that.numberOfReplicas
&& numberOfSearchReplicas == that.numberOfSearchReplicas
&& activeShards == that.activeShards
&& relocatingShards == that.relocatingShards
&& initializingShards == that.initializingShards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ protected Table getTableWithHeader(final RestRequest request, final PageToken pa
table.addCell("uuid", "alias:id,uuid;desc:index uuid");
table.addCell("pri", "alias:p,shards.primary,shardsPrimary;text-align:right;desc:number of primary shards");
table.addCell("rep", "alias:r,shards.replica,shardsReplica;text-align:right;desc:number of replica shards");
table.addCell("srep", "alias:s,shards.searchReplica,shardsSearchReplica;text-align:right;desc:number of search replica shards");
table.addCell("docs.count", "alias:dc,docsCount;text-align:right;desc:available docs");
table.addCell("docs.deleted", "alias:dd,docsDeleted;text-align:right;desc:deleted docs");

Expand Down Expand Up @@ -847,6 +848,7 @@ protected Table buildTable(
table.addCell(indexMetadata.getIndexUUID());
table.addCell(indexHealth == null ? null : indexHealth.getNumberOfShards());
table.addCell(indexHealth == null ? null : indexHealth.getNumberOfReplicas());
table.addCell(indexHealth == null ? null : indexHealth.getNumberOfSearchReplicas());

table.addCell(primaryStats.getDocs() == null ? null : primaryStats.getDocs().getCount());
table.addCell(primaryStats.getDocs() == null ? null : primaryStats.getDocs().getDeleted());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public static ClusterIndexHealth randomIndexHealth(String indexName, ClusterHeal
randomInt(1000),
randomInt(1000),
randomInt(1000),
randomInt(1000),
randomFrom(ClusterHealthStatus.values()),
shards
);
Expand Down Expand Up @@ -164,6 +165,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
"index",
"numberOfShards",
"numberOfReplicas",
"numberOfSearchReplicas",
"activeShards",
"relocatingShards",
"initializingShards",
Expand All @@ -178,6 +180,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex() + randomAlphaOfLengthBetween(2, 5),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -191,6 +194,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards() + between(1, 10),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -204,6 +208,21 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas() + between(1, 10),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
instance.getUnassignedShards(),
instance.getActivePrimaryShards(),
instance.getStatus(),
instance.getShards()
);
case "numberOfSearchReplicas":
return new ClusterIndexHealth(
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas() + between(1, 10),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -217,6 +236,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards() + between(1, 10),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -230,6 +250,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards() + between(1, 10),
instance.getInitializingShards(),
Expand All @@ -243,6 +264,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards() + between(1, 10),
Expand All @@ -256,6 +278,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -269,6 +292,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -287,6 +311,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand All @@ -307,6 +332,7 @@ protected ClusterIndexHealth mutateInstance(ClusterIndexHealth instance) throws
instance.getIndex(),
instance.getNumberOfShards(),
instance.getNumberOfReplicas(),
instance.getNumberOfSearchReplicas(),
instance.getActiveShards(),
instance.getRelocatingShards(),
instance.getInitializingShards(),
Expand Down
Loading