Skip to content

Commit 9f7a68e

Browse files
author
Gagan Singh Saini
committed
Fixing breaking changes
Signed-off-by: Gagan Singh Saini <gagasa@amazon.com>
1 parent c66b548 commit 9f7a68e

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4343
- [Search Stats] Add search & star-tree search query failure count metrics ([#19210](https://github.com/opensearch-project/OpenSearch/issues/19210))
4444
- [Star-tree] Support for multi-terms aggregation ([#18398](https://github.com/opensearch-project/OpenSearch/issues/18398))
4545
- Add stream search enabled cluster setting and auto fallback logic ([#19506](https://github.com/opensearch-project/OpenSearch/pull/19506))
46+
- Add seperate shard limit validation for local and remote indices ([#19532](https://github.com/opensearch-project/OpenSearch/pull/19532))
4647
- Implement GRPC Exists, Regexp, and Wildcard queries ([#19392](https://github.com/opensearch-project/OpenSearch/pull/19392))
4748
- Implement GRPC GeoBoundingBox, GeoDistance queries ([#19451](https://github.com/opensearch-project/OpenSearch/pull/19451))
4849
- Implement GRPC Ids, Range, and Terms Set queries ([#19448](https://github.com/opensearch-project/OpenSearch/pull/19448))

server/src/main/java/org/opensearch/cluster/metadata/Metadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ public int getTotalNumberOfShards() {
912912
* replicas, but does not include shards that are part of closed indices.
913913
* @return The total number of open shards from all indices.
914914
*/
915-
public int getTotalOpenLocalOnlyIndexShards() {
915+
public int getTotalOpenIndexShards() {
916916
return this.totalOpenLocalOnlyIndexShards;
917917
}
918918

server/src/main/java/org/opensearch/indices/ShardLimitValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public Optional<String> checkShardLimit(int newShards, ClusterState state, Routi
340340
)
341341
: checkShardLimit(
342342
newShards,
343-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
343+
state.getMetadata().getTotalOpenIndexShards(),
344344
getShardLimitPerNode(),
345345
getShardLimitPerCluster(),
346346
state.getNodes().getDataNodes().size(),

server/src/test/java/org/opensearch/indices/ShardLimitValidatorTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testOverShardLimit() {
7979
int shardsToAdd = counts.getFailingIndexShards() * (1 + counts.getFailingIndexReplicas());
8080
Optional<String> errorMessage = ShardLimitValidator.checkShardLimit(
8181
shardsToAdd,
82-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
82+
state.getMetadata().getTotalOpenIndexShards(),
8383
counts.getShardsPerNode(),
8484
-1,
8585
state.getNodes().getDataNodes().size(),
@@ -111,7 +111,7 @@ public void testOverShardLimitWithMaxShardCountLimit() {
111111
int maxShardLimitOnCluster = shardsToAdd - 1;
112112
Optional<String> errorMessage = ShardLimitValidator.checkShardLimit(
113113
shardsToAdd,
114-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
114+
state.getMetadata().getTotalOpenIndexShards(),
115115
counts.getShardsPerNode(),
116116
maxShardLimitOnCluster,
117117
state.getNodes().getDataNodes().size(),
@@ -147,7 +147,7 @@ public void testUnderShardLimit() {
147147
int shardsToAdd = randomIntBetween(1, (counts.getShardsPerNode() * nodesInCluster) - existingShards);
148148
Optional<String> errorMessage = ShardLimitValidator.checkShardLimit(
149149
shardsToAdd,
150-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
150+
state.getMetadata().getTotalOpenIndexShards(),
151151
counts.getShardsPerNode(),
152152
-1,
153153
state.getNodes().getDataNodes().size(),
@@ -235,7 +235,7 @@ public void testComputedMaxShardsOfClusterIntOverFlow() {
235235
ClusterState state = createClusterForShardLimitTest(15, 1, 1);
236236
Optional<String> errorMessage = ShardLimitValidator.checkShardLimit(
237237
2,
238-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
238+
state.getMetadata().getTotalOpenIndexShards(),
239239
maxShardLimitPerNode,
240240
-1,
241241
state.getNodes().getDataNodes().size(),
@@ -245,7 +245,7 @@ public void testComputedMaxShardsOfClusterIntOverFlow() {
245245

246246
errorMessage = ShardLimitValidator.checkShardLimit(
247247
Integer.MAX_VALUE - 1,
248-
state.getMetadata().getTotalOpenLocalOnlyIndexShards(),
248+
state.getMetadata().getTotalOpenIndexShards(),
249249
maxShardLimitPerNode,
250250
-1,
251251
state.getNodes().getDataNodes().size(),

0 commit comments

Comments
 (0)