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
Sophia committed Jun 19, 2024
1 parent 802f2e6 commit 950f0ad
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ 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));
if (isFilteredRequest(request)) {
Expand Down

0 comments on commit 950f0ad

Please sign in to comment.