From 455dab7322c4fd43c5d6837619caab37537766bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Jun 2024 09:09:53 +0000 Subject: [PATCH] Pass correct names for snapshot indices while updating remote store index settings (#13529) Signed-off-by: Lakshya Taragi (cherry picked from commit cf2c31fffe844f78f17cf1c2a780198b9b6258d4) Signed-off-by: github-actions[bot] --- .../main/java/org/opensearch/snapshots/RestoreService.java | 2 +- .../cluster/metadata/MetadataCreateIndexServiceTests.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/snapshots/RestoreService.java b/server/src/main/java/org/opensearch/snapshots/RestoreService.java index 5ae67d04c7837..f102289160b71 100644 --- a/server/src/main/java/org/opensearch/snapshots/RestoreService.java +++ b/server/src/main/java/org/opensearch/snapshots/RestoreService.java @@ -716,7 +716,7 @@ private Settings getOverrideSettingsInternal() { clusterService.state(), clusterSettings, clusterService.getSettings(), - request.getDescription() + String.join(",", request.indices()) ); return settingsBuilder.build(); } diff --git a/server/src/test/java/org/opensearch/cluster/metadata/MetadataCreateIndexServiceTests.java b/server/src/test/java/org/opensearch/cluster/metadata/MetadataCreateIndexServiceTests.java index de1d422d6016b..98130b0af52dd 100644 --- a/server/src/test/java/org/opensearch/cluster/metadata/MetadataCreateIndexServiceTests.java +++ b/server/src/test/java/org/opensearch/cluster/metadata/MetadataCreateIndexServiceTests.java @@ -1603,7 +1603,7 @@ public void testNewIndexIsRemoteStoreBackedForRemoteStoreDirectionAndMixedMode() ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); - request = new CreateIndexClusterStateUpdateRequest("create index", "test", "test"); + request = new CreateIndexClusterStateUpdateRequest("create index", "test-index", "test-index"); Settings indexSettings = aggregateIndexSettings( clusterState, @@ -1684,7 +1684,7 @@ public void testNewIndexIsRemoteStoreBackedForRemoteStoreDirectionAndMixedMode() finalClusterSettings ); }); - + assertEquals(error.getMessage(), "failed to create index [test-index]"); assertThat( error.getCause().getMessage(), containsString("Cluster is migrating to remote store but no remote node found, failing index creation")