Don't request cluster metadata in _cat/shards impl (#59548)

Today `GET _cat/shards` requests the nodes, routing table, and metadata
from the cluster state, but it does not use any information from the
metadata portion of the response. Metadata includes things like mappings
and templates that may be substantial in size.

This commit drops the unnecessary metadata portion of this cluster state
request.
This commit is contained in:
David Turner 2020-07-15 10:04:04 +01:00
parent 66ef1cdad7
commit 0c2510dc68
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ public class RestShardsAction extends AbstractCatAction {
final ClusterStateRequest clusterStateRequest = new ClusterStateRequest();
clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local()));
clusterStateRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterStateRequest.masterNodeTimeout()));
clusterStateRequest.clear().nodes(true).metadata(true).routingTable(true).indices(indices);
clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices);
return channel -> client.admin().cluster().state(clusterStateRequest, new RestActionListener<ClusterStateResponse>(channel) {
@Override
public void processResponse(final ClusterStateResponse clusterStateResponse) {