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

Signed-off-by: Sophia <[email protected]>
  • Loading branch information
Sophia committed Jun 19, 2024
1 parent 8e32ed7 commit 6e32fb5
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 @@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
- Fix handling of Short and Byte data types in ScriptProcessor ingest pipeline ([#14379](https://github.com/opensearch-project/OpenSearch/issues/14379))
- Switch to iterative version of WKT format parser ([#14086](https://github.com/opensearch-project/OpenSearch/pull/14086))
- Updated GET {index}/_settings to return `number_of_routing_shards` ([#14446](https://github.com/opensearch-project/OpenSearch/pull/14446))

### Security

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 6e32fb5

Please sign in to comment.