diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java b/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java index cae9472f323f1..01efa96a7369e 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/shards/TransportCatShardsAction.java @@ -122,11 +122,6 @@ public void onResponse(ClusterStateResponse clusterStateResponse) { indicesStatsRequest.setShouldCancelOnTimeout(true); indicesStatsRequest.all(); indicesStatsRequest.indices(indices); - // Since the indices for paginated query are already concrete and have been filtered to - // only consider OPEN indices, invoking IndexNameExpressionResolver should be avoided. - if (paginationStrategy != null) { - indicesStatsRequest.skipIndexNameResolver(true); - } indicesStatsRequest.setParentTask(client.getLocalNodeId(), parentTask.getId()); client.admin().indices().stats(indicesStatsRequest, new ActionListener() { @Override diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java index b3ede1d5f606c..c36e53098d166 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/IndicesStatsRequest.java @@ -32,7 +32,6 @@ package org.opensearch.action.admin.indices.stats; -import org.opensearch.Version; import org.opensearch.action.support.broadcast.BroadcastRequest; import org.opensearch.common.annotation.PublicApi; import org.opensearch.core.common.io.stream.StreamInput; @@ -58,7 +57,6 @@ public class IndicesStatsRequest extends BroadcastRequest { private CommonStatsFlags flags = new CommonStatsFlags(); - private boolean skipIndexNameResolver = false; public IndicesStatsRequest() { super((String[]) null); @@ -67,9 +65,6 @@ public IndicesStatsRequest() { public IndicesStatsRequest(StreamInput in) throws IOException { super(in); flags = new CommonStatsFlags(in); - if (in.getVersion().onOrAfter(Version.V_3_0_0)) { - skipIndexNameResolver = in.readBoolean(); - } } /** @@ -306,22 +301,10 @@ public IndicesStatsRequest includeUnloadedSegments(boolean includeUnloadedSegmen public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); flags.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_3_0_0)) { - out.writeBoolean(skipIndexNameResolver); - } } @Override public boolean includeDataStreams() { return true; } - - public boolean skipIndexNameResolver() { - return skipIndexNameResolver; - } - - public IndicesStatsRequest skipIndexNameResolver(boolean skipIndexNameResolver) { - this.skipIndexNameResolver = skipIndexNameResolver; - return this; - } } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java index 7ddec140b49a6..2b85b6d5d6b5b 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/TransportIndicesStatsAction.java @@ -56,7 +56,6 @@ import org.opensearch.transport.TransportService; import java.io.IOException; -import java.util.Arrays; import java.util.List; /** @@ -154,15 +153,4 @@ protected ShardStats shardOperation(IndicesStatsRequest request, ShardRouting sh } return new ShardStats(indexShard.routingEntry(), indexShard.shardPath(), commonStats, commitStats, seqNoStats, retentionLeaseStats); } - - @Override - protected String[] resolveConcreteIndexNames(ClusterState clusterState, IndicesStatsRequest request) { - if (request.skipIndexNameResolver()) { - // filter out all the indices which might not be present in the local clusterState - return Arrays.stream(request.indices()) - .filter(index -> clusterState.metadata().indices().containsKey(index)) - .toArray(String[]::new); - } - return super.resolveConcreteIndexNames(clusterState, request); - } }