Skip to content

Commit

Permalink
Adding number of routing shards to index settings before passing into…
Browse files Browse the repository at this point in the history
… GetSettingsResponse
  • Loading branch information
PeacefulTortoise committed Jun 19, 2024
1 parent 802f2e6 commit ede87d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- Add fingerprint ingest processor ([#13724](https://github.com/opensearch-project/OpenSearch/pull/13724))
- [Remote Store] Rate limiter for remote store low priority uploads ([#14374](https://github.com/opensearch-project/OpenSearch/pull/14374/))
- Updated GET {index}/_settings to return `number_of_routing_shards` ([#14443](https://github.com/opensearch-project/OpenSearch/pull/14443))

### Dependencies
- Bump `org.gradle.test-retry` from 1.5.8 to 1.5.9 ([#13442](https://github.com/opensearch-project/OpenSearch/pull/13442))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ protected void clusterManagerOperation(GetSettingsRequest request, ClusterState
indexSettings = indexSettings.filter(k -> Regex.simpleMatch(request.names(), k));
}

indexSettings = Settings.builder()
.put(indexSettings)
.put(IndexMetadata.INDEX_NUMBER_OF_ROUTING_SHARDS_SETTING.getKey(), indexMetadata.getRoutingNumShards())
.build();

indexToSettingsBuilder.put(concreteIndex.getName(), indexSettings);
if (request.includeDefaults()) {
Settings defaultSettings = settingsFilter.filter(indexScopedSettings.diff(indexSettings, Settings.EMPTY));
Expand Down

0 comments on commit ede87d5

Please sign in to comment.