Skip to content
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
5 changes: 5 additions & 0 deletions docs/changelog/110993.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 110993
summary: Add link to Max Shards Per Node exception message
area: Distributed
type: enhancement
issues: []
1 change: 1 addition & 0 deletions docs/reference/how-to/size-your-shards.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ POST _reindex
Here’s how to resolve common shard-related errors.

[discrete]
[[troubleshooting-max-shards-open]]
==== this action would add [x] total shards, but this cluster currently has [y]/[z] maximum shards open;

The <<cluster-max-shards-per-node,`cluster.max_shards_per_node`>> cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.common.Priority;
import org.elasticsearch.common.ReferenceDocs;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.index.IndexVersion;
Expand Down Expand Up @@ -152,7 +153,9 @@ public void testIncreaseReplicasOverLimit() {
+ firstShardCount
+ "]/["
+ dataNodes * shardsPerNode
+ "] maximum normal shards open;";
+ "] maximum normal shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE
+ ";";
assertEquals(expectedError, e.getMessage());
}
Metadata clusterState = clusterAdmin().prepareState().get().getState().metadata();
Expand Down Expand Up @@ -211,7 +214,9 @@ public void testChangingMultipleIndicesOverLimit() {
+ totalShardsBefore
+ "]/["
+ dataNodes * shardsPerNode
+ "] maximum normal shards open;";
+ "] maximum normal shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE
+ ";";
assertEquals(expectedError, e.getMessage());
}
Metadata clusterState = clusterAdmin().prepareState().get().getState().metadata();
Expand Down Expand Up @@ -403,7 +408,9 @@ private void verifyException(int dataNodes, ShardCounts counts, IllegalArgumentE
+ currentShards
+ "]/["
+ maxShards
+ "] maximum normal shards open;";
+ "] maximum normal shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE
+ ";";
assertEquals(expectedError, e.getMessage());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public enum ReferenceDocs {
SNAPSHOT_REPOSITORY_ANALYSIS,
S3_COMPATIBLE_REPOSITORIES,
LUCENE_MAX_DOCS_LIMIT,
MAX_SHARDS_PER_NODE,
// this comment keeps the ';' on the next line so every entry above has a trailing ',' which makes the diff for adding new links cleaner
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.ReferenceDocs;
import org.elasticsearch.common.ValidationException;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -296,7 +297,8 @@ static String errorMessageFrom(Result result) {
+ result.maxShardsInCluster
+ "] maximum "
+ result.group
+ " shards open";
+ " shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
"NETWORK_BINDING_AND_PUBLISHING": "modules-network.html#modules-network-binding-publishing",
"SNAPSHOT_REPOSITORY_ANALYSIS": "repo-analysis-api.html",
"S3_COMPATIBLE_REPOSITORIES": "repository-s3.html#repository-s3-compatible-services",
"LUCENE_MAX_DOCS_LIMIT": "size-your-shards.html#troubleshooting-max-docs-limit"
"LUCENE_MAX_DOCS_LIMIT": "size-your-shards.html#troubleshooting-max-docs-limit",
"MAX_SHARDS_PER_NODE": "size-your-shards.html#troubleshooting-max-shards-open"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.cluster.shards.ShardCounts;
import org.elasticsearch.common.ReferenceDocs;
import org.elasticsearch.common.ValidationException;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
Expand Down Expand Up @@ -79,7 +80,8 @@ private void testOverShardLimit(CheckShardLimitMethod targetMethod, String group
+ maxShards
+ "] maximum "
+ group
+ " shards open",
+ " shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE,
ShardLimitValidator.errorMessageFrom(shardLimitsResult)
);
assertEquals(shardLimitsResult.maxShardsInCluster(), maxShards);
Expand Down Expand Up @@ -151,7 +153,9 @@ public void testValidateShardLimitOpenIndices() {
+ maxShards
+ "] maximum "
+ group
+ " shards open;",
+ " shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE
+ ";",
exception.getMessage()
);
}
Expand Down Expand Up @@ -179,7 +183,9 @@ public void testValidateShardLimitUpdateReplicas() {
+ shardsPerNode * nodesInCluster
+ "] maximum "
+ group
+ " shards open;",
+ " shards open; for more information, see "
+ ReferenceDocs.MAX_SHARDS_PER_NODE
+ ";",
exception.getMessage()
);
}
Expand Down