From c9b04873c120793a3461b0546d8f480f66783dd9 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Thu, 14 Mar 2024 21:20:02 +0530 Subject: [PATCH 01/10] Adding checks to reject Resize index requests. i.e, split, shrink and clone, While migration is in progress Signed-off-by: Shubh Sahu --- .../indices/shrink/TransportResizeAction.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index ca4c16935c2b9..4ee551bf3637d 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -48,6 +48,7 @@ import org.opensearch.cluster.node.DiscoveryNode; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; +import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; import org.opensearch.core.action.ActionListener; import org.opensearch.core.common.io.stream.StreamInput; @@ -59,6 +60,7 @@ import org.opensearch.index.store.StoreStats; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; +import org.opensearch.node.remotestore.RemoteStoreNodeService; import java.io.IOException; import java.util.Locale; @@ -67,6 +69,7 @@ import java.util.function.IntFunction; import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE_ENABLED; /** * Main class to initiate resizing (shrink / split) an index into a new index @@ -140,8 +143,10 @@ protected void clusterManagerOperation( // there is no need to fetch docs stats for split but we keep it simple and do it anyway for simplicity of the code final String sourceIndex = indexNameExpressionResolver.resolveDateMathExpression(resizeRequest.getSourceIndex()); final String targetIndex = indexNameExpressionResolver.resolveDateMathExpression(resizeRequest.getTargetIndexRequest().index()); - IndexMetadata indexMetadata = state.metadata().index(sourceIndex); + ClusterSettings clusterSettings = clusterService.getClusterSettings(); + validateClusterModeSettings(resizeRequest.getResizeType(),indexMetadata,clusterSettings); + if (resizeRequest.getResizeType().equals(ResizeType.SHRINK) && state.metadata().isSegmentReplicationEnabled(sourceIndex) && indexMetadata != null @@ -368,4 +373,19 @@ protected static int calculateTargetIndexShardsNum( protected String getClusterManagerActionName(DiscoveryNode node) { return super.getClusterManagerActionName(node); } + + private static void validateClusterModeSettings(final ResizeType type,IndexMetadata sourceIndexMetadata,ClusterSettings clusterSettings) { + boolean isMixed = clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) + .equals(RemoteStoreNodeService.CompatibilityMode.MIXED); + boolean isRemoteStoreMigrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) + .equals(RemoteStoreNodeService.Direction.REMOTE_STORE); + boolean isRemoteStoreEnabled = false; + if(sourceIndexMetadata!=null) { + isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); + } + if (isMixed && isRemoteStoreMigrationDirection && !isRemoteStoreEnabled) { + throw new IllegalStateException("index Resizing for type [" + type + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [Remote Store]"); + } + } } From 45489510b9527f9b8cc8227101ef259fbf5c0df4 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Fri, 15 Mar 2024 13:25:33 +0530 Subject: [PATCH 02/10] Adding issue to changelog.md file Signed-off-by: Shubh Sahu --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cac3b74fe716c..385ebb552f378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Views, simplify data access and manipulation by providing a virtual layer over one or more indices ([#11957](https://github.com/opensearch-project/OpenSearch/pull/11957)) - Add Remote Store Migration Experimental flag and allow mixed mode clusters under same ([#11986](https://github.com/opensearch-project/OpenSearch/pull/11986)) - [Admission Control] Integrate IO Usage Tracker to the Resource Usage Collector Service and Emit IO Usage Stats ([#11880](https://github.com/opensearch-project/OpenSearch/pull/11880)) +- Reject Resize index requests (i.e, split, shrink and clone), While DocRep to SegRep migration is in progress.([#12686](https://github.com/opensearch-project/OpenSearch/pull/12686)) ### Dependencies - Bump `log4j-core` from 2.18.0 to 2.19.0 From 6672cbe9dd74708e6bb1cb29a1f5d15e473e43ba Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Mon, 18 Mar 2024 14:02:57 +0530 Subject: [PATCH 03/10] Some structural changes and added UTs to cover all possible configuration Signed-off-by: Shubh Sahu --- .../indices/shrink/TransportResizeAction.java | 13 +- .../shrink/TransportResizeActionTests.java | 147 +++++++++++++++++- 2 files changed, 150 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 4ee551bf3637d..6539aa75f7d8f 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -145,8 +145,6 @@ protected void clusterManagerOperation( final String targetIndex = indexNameExpressionResolver.resolveDateMathExpression(resizeRequest.getTargetIndexRequest().index()); IndexMetadata indexMetadata = state.metadata().index(sourceIndex); ClusterSettings clusterSettings = clusterService.getClusterSettings(); - validateClusterModeSettings(resizeRequest.getResizeType(),indexMetadata,clusterSettings); - if (resizeRequest.getResizeType().equals(ResizeType.SHRINK) && state.metadata().isSegmentReplicationEnabled(sourceIndex) && indexMetadata != null @@ -166,7 +164,7 @@ protected void clusterManagerOperation( CreateIndexClusterStateUpdateRequest updateRequest = prepareCreateIndexRequest(resizeRequest, state, i -> { IndexShardStats shard = indicesStatsResponse.getIndex(sourceIndex).getIndexShards().get(i); return shard == null ? null : shard.getPrimary().getDocs(); - }, indicesStatsResponse.getPrimaries().store, sourceIndex, targetIndex); + }, indicesStatsResponse.getPrimaries().store, clusterSettings,sourceIndex, targetIndex); if (indicesStatsResponse.getIndex(sourceIndex) .getTotal() @@ -205,7 +203,7 @@ protected void clusterManagerOperation( CreateIndexClusterStateUpdateRequest updateRequest = prepareCreateIndexRequest(resizeRequest, state, i -> { IndexShardStats shard = indicesStatsResponse.getIndex(sourceIndex).getIndexShards().get(i); return shard == null ? null : shard.getPrimary().getDocs(); - }, indicesStatsResponse.getPrimaries().store, sourceIndex, targetIndex); + }, indicesStatsResponse.getPrimaries().store, clusterSettings, sourceIndex, targetIndex); createIndexService.createIndex( updateRequest, ActionListener.map( @@ -228,6 +226,7 @@ static CreateIndexClusterStateUpdateRequest prepareCreateIndexRequest( final ClusterState state, final IntFunction perShardDocStats, final StoreStats primaryShardsStoreStats, + final ClusterSettings clusterSettings, String sourceIndexName, String targetIndexName ) { @@ -236,6 +235,7 @@ static CreateIndexClusterStateUpdateRequest prepareCreateIndexRequest( if (metadata == null) { throw new IndexNotFoundException(sourceIndexName); } + validateClusterModeSettings(resizeRequest.getResizeType(),metadata,clusterSettings); final Settings.Builder targetIndexSettingsBuilder = Settings.builder() .put(targetIndex.settings()) .normalizePrefix(IndexMetadata.INDEX_SETTING_PREFIX); @@ -379,10 +379,7 @@ private static void validateClusterModeSettings(final ResizeType type,IndexMetad .equals(RemoteStoreNodeService.CompatibilityMode.MIXED); boolean isRemoteStoreMigrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) .equals(RemoteStoreNodeService.Direction.REMOTE_STORE); - boolean isRemoteStoreEnabled = false; - if(sourceIndexMetadata!=null) { - isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); - } + boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); if (isMixed && isRemoteStoreMigrationDirection && !isRemoteStoreEnabled) { throw new IllegalStateException("index Resizing for type [" + type + "] is not allowed as Cluster mode is [Mixed]" + " and migration direction is [Remote Store]"); diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index 848df5f8e4979..341e6843f05ea 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -51,21 +51,34 @@ import org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator; import org.opensearch.cluster.routing.allocation.decider.AllocationDeciders; import org.opensearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider; +import org.opensearch.common.settings.ClusterSettings; import org.opensearch.common.settings.Settings; +import org.opensearch.common.util.FeatureFlags; import org.opensearch.core.common.unit.ByteSizeValue; +import org.opensearch.index.query.Rewriteable; +import org.opensearch.index.query.RewriteableTests; import org.opensearch.index.shard.DocsStats; import org.opensearch.index.store.StoreStats; +import org.opensearch.node.remotestore.RemoteStoreNodeService; import org.opensearch.snapshots.EmptySnapshotsInfoService; import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.gateway.TestGatewayAllocator; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.Matchers.*; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE_ENABLED; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.CompatibilityMode; + + import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import static java.util.Collections.emptyMap; -import static org.hamcrest.Matchers.equalTo; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING; +import static org.opensearch.common.util.FeatureFlags.REMOTE_STORE_MIGRATION_EXPERIMENTAL; public class TransportResizeActionTests extends OpenSearchTestCase { @@ -95,6 +108,15 @@ private ClusterState createClusterState(String name, int numShards, int numRepli return clusterState; } + private ClusterSettings createClusterSettings(CompatibilityMode compatibilityMode, RemoteStoreNodeService.Direction migrationDirection) { + ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); + clusterSettings.applySettings( + (Settings.builder().put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), compatibilityMode) + .put(MIGRATION_DIRECTION_SETTING.getKey(), migrationDirection)).build() + ); + return clusterSettings; + } + public void testErrorCondition() { ClusterState state = createClusterState( "source", @@ -102,6 +124,7 @@ public void testErrorCondition() { randomIntBetween(0, 10), Settings.builder().put("index.blocks.write", true).build() ); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); assertTrue( expectThrows( IllegalStateException.class, @@ -110,6 +133,7 @@ public void testErrorCondition() { state, (i) -> new DocsStats(Integer.MAX_VALUE, between(1, 1000), between(1, 100)), new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ) @@ -125,6 +149,7 @@ public void testErrorCondition() { clusterState, (i) -> i == 2 || i == 3 ? new DocsStats(Integer.MAX_VALUE / 2, between(1, 1000), between(1, 10000)) : null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -144,6 +169,7 @@ public void testErrorCondition() { clusterState, (i) -> new DocsStats(between(10, 1000), between(1, 10), between(1, 10000)), new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -173,6 +199,7 @@ public void testErrorCondition() { clusterState, (i) -> new DocsStats(between(1, 1000), between(1, 1000), between(0, 10000)), new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -189,7 +216,7 @@ public void testPassNumRoutingShards() { EmptyClusterInfoService.INSTANCE, EmptySnapshotsInfoService.INSTANCE ); - + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -204,6 +231,7 @@ public void testPassNumRoutingShards() { clusterState, null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -217,6 +245,7 @@ public void testPassNumRoutingShards() { clusterState, null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -235,6 +264,7 @@ public void testPassNumRoutingShardsAndFail() { EmptySnapshotsInfoService.INSTANCE ); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -249,6 +279,7 @@ public void testPassNumRoutingShardsAndFail() { clusterState, null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ); @@ -265,6 +296,7 @@ public void testPassNumRoutingShardsAndFail() { finalState, null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, "source", "target" ) @@ -286,6 +318,7 @@ public void testShrinkIndexSettings() { EmptySnapshotsInfoService.INSTANCE ); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -301,6 +334,7 @@ public void testShrinkIndexSettings() { clusterState, (i) -> stats, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, indexName, "target" ); @@ -325,6 +359,8 @@ public void testShrinkWithMaxShardSize() { EmptyClusterInfoService.INSTANCE, EmptySnapshotsInfoService.INSTANCE ); + + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -345,6 +381,7 @@ public void testShrinkWithMaxShardSize() { clusterState, (i) -> stats, new StoreStats(100, between(1, 10000)), + clusterSettings, indexName, "target" ); @@ -366,6 +403,7 @@ public void testShrinkWithMaxShardSize() { clusterState, (i) -> stats, new StoreStats(100, between(1, 10000)), + clusterSettings, indexName, "target" ); @@ -387,6 +425,7 @@ public void testShrinkWithMaxShardSize() { clusterState, (i) -> stats, new StoreStats(100, between(1, 10000)), + clusterSettings, indexName, "target" ); @@ -477,6 +516,7 @@ public void testIndexBlocks() { createClusterState(indexName, 10, 0, 40, Settings.builder().put("index.blocks.read_only", true).build()) ).nodes(DiscoveryNodes.builder().add(newNode("node1"))).build(); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); // Target index will be blocked by [index.blocks.read_only=true] copied from the source index ResizeRequest resizeRequest = new ResizeRequest("target", indexName); ResizeType resizeType; @@ -500,6 +540,7 @@ public void testIndexBlocks() { finalState, null, new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, indexName, "target" ) @@ -551,6 +592,7 @@ public void testIndexBlocks() { clusterState, (i) -> stats, new StoreStats(100, between(1, 10000)), + clusterSettings, indexName, "target" ); @@ -561,6 +603,107 @@ public void testIndexBlocks() { assertEquals(request.waitForActiveShards(), activeShardCount); } + public void testResizeFailuresDuringMigration() { + //We will keep all other settings correct for resize request, + //So we only need to test for the failures due to cluster setting validation while migration + final Settings directionEnabledNodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build(); + FeatureFlags.initializeFeatureFlags(directionEnabledNodeSettings); + boolean isRemoteStoreEnabled = randomBoolean(); + CompatibilityMode compatibilityMode = randomFrom(CompatibilityMode.values()); + RemoteStoreNodeService.Direction migrationDirection = randomFrom(RemoteStoreNodeService.Direction.values()); + //If not mixed mode, then migration direction is NONE. + if(!compatibilityMode.equals(CompatibilityMode.MIXED)){ + migrationDirection = RemoteStoreNodeService.Direction.NONE; + } + ClusterSettings clusterSettings = createClusterSettings(compatibilityMode,migrationDirection); + + ClusterState clusterState = ClusterState.builder( + createClusterState("source", 10, 0,40, + Settings.builder().put("index.blocks.write", true) + .put(SETTING_REMOTE_STORE_ENABLED, isRemoteStoreEnabled) + .build()) + ).nodes(DiscoveryNodes.builder().add(newNode("node1"))).build(); + AllocationService service = new AllocationService( + new AllocationDeciders(Collections.singleton(new MaxRetryAllocationDecider())), + new TestGatewayAllocator(), + new BalancedShardsAllocator(Settings.EMPTY), + EmptyClusterInfoService.INSTANCE, + EmptySnapshotsInfoService.INSTANCE + ); + + RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); + clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); + // now we start the shard + routingTable = OpenSearchAllocationTestCase.startInitializingShardsAndReroute(service, clusterState, "source").routingTable(); + clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); + DocsStats stats = new DocsStats(between(0, (IndexWriter.MAX_DOCS) / 10), between(1, 1000), between(1, 10000)); + ResizeRequest resizeRequest = new ResizeRequest("target", "source"); + ResizeType resizeType; + int expectedShardsNum; + String cause; + switch (randomIntBetween(0, 2)) { + case 0: + resizeType = ResizeType.SHRINK; + expectedShardsNum = 5; + cause = "shrink_index"; + break; + case 1: + resizeType = ResizeType.SPLIT; + expectedShardsNum = 20; + cause = "split_index"; + break; + default: + resizeType = ResizeType.CLONE; + expectedShardsNum = 10; + cause = "clone_index"; + } + resizeRequest.setResizeType(resizeType); + resizeRequest.getTargetIndexRequest() + .settings(Settings.builder().put("index.number_of_shards", expectedShardsNum).put("index.blocks.read_only", false).build()); + final ActiveShardCount activeShardCount = randomBoolean() ? ActiveShardCount.ALL : ActiveShardCount.ONE; + resizeRequest.setWaitForActiveShards(activeShardCount); + //startsWith("index Resizing for type [") + if (compatibilityMode == CompatibilityMode.MIXED + && migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE + && !isRemoteStoreEnabled) { + ClusterState finalState = clusterState; + IllegalStateException ise = expectThrows( + IllegalStateException.class, + () ->TransportResizeAction.prepareCreateIndexRequest( + new ResizeRequest("target", "source"), + finalState, + (i) -> stats, + new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, + "source", + "target" + ) + ); + assertThat( + ise.getMessage(), + allOf( + startsWith("index Resizing for type"), + endsWith("Cluster mode is [Mixed] and migration direction is [Remote Store]") + ) + ); + } else { + CreateIndexClusterStateUpdateRequest request = TransportResizeAction.prepareCreateIndexRequest( + resizeRequest, + clusterState, + (i) -> stats, + new StoreStats(100, between(1, 10000)), + clusterSettings, + "source", + "target" + ); + assertNotNull(request.recoverFrom()); + assertEquals("source", request.recoverFrom().getName()); + assertEquals(String.valueOf(expectedShardsNum), request.settings().get("index.number_of_shards")); + assertEquals(cause, request.cause()); + assertEquals(request.waitForActiveShards(), activeShardCount); + } + } + private DiscoveryNode newNode(String nodeId) { final Set roles = Collections.unmodifiableSet( new HashSet<>(Arrays.asList(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE, DiscoveryNodeRole.DATA_ROLE)) From ace77526a526d35d0bc8801053b66be60c2a3cb9 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Tue, 19 Mar 2024 17:02:52 +0530 Subject: [PATCH 04/10] Added IT for ResizeIndex During migration Signed-off-by: Shubh Sahu --- .../ResizeIndexMigrationTestCase.java | 119 ++++++++++++++++++ .../indices/shrink/TransportResizeAction.java | 24 ++-- .../shrink/TransportResizeActionTests.java | 68 +++++----- 3 files changed, 170 insertions(+), 41 deletions(-) create mode 100644 server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java new file mode 100644 index 0000000000000..db5979143e4cc --- /dev/null +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -0,0 +1,119 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.remotemigration; + +import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; +import org.opensearch.action.admin.indices.shrink.ResizeType; +import org.opensearch.action.support.ActiveShardCount; +import org.opensearch.client.Client; +import org.opensearch.common.settings.Settings; +import org.opensearch.indices.replication.common.ReplicationType; +import org.opensearch.test.OpenSearchIntegTestCase; + +import java.util.List; + +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REPLICATION_TYPE; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING; +import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; + +@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0, autoManageMasterNodes = false) +public class ResizeIndexMigrationTestCase extends MigrationBaseTestCase { + private static final String TEST_INDEX = "test_index"; + private final static String REMOTE_STORE_DIRECTION = "remote_store"; + private final static String NONE_DIRECTION = "none"; + private final static String STRICT_MODE = "strict"; + private final static String MIXED_MODE = "mixed"; + + public void testFailResizeIndexWhileMigration() throws Exception { + + internalCluster().setBootstrapClusterManagerNodeIndex(0); + List cmNodes = internalCluster().startNodes(1); + Client client = internalCluster().client(cmNodes.get(0)); + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.persistentSettings(Settings.builder().put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), MIXED_MODE)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + // Adding a non remote and a remote node + addRemote = false; + String nonRemoteNodeName = internalCluster().startNode(); + + addRemote = true; + String remoteNodeName = internalCluster().startNode(); + + logger.info("-->Create index on non-remote node and SETTING_REMOTE_STORE_ENABLED is false. Resize should not happen"); + Settings.Builder builder = Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT); + client.admin() + .indices() + .prepareCreate(TEST_INDEX) + .setSettings( + builder.put("index.number_of_shards", 10) + .put("index.number_of_replicas", 0) + .put("index.routing.allocation.include._name", nonRemoteNodeName) + .put("index.routing.allocation.exclude._name", remoteNodeName) + ) + .setWaitForActiveShards(ActiveShardCount.ALL) + .execute() + .actionGet(); + + updateSettingsRequest.persistentSettings(Settings.builder().put(MIGRATION_DIRECTION_SETTING.getKey(), REMOTE_STORE_DIRECTION)); + assertAcked(client.admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + ResizeType resizeType; + int resizeShardsNum; + String cause; + switch (randomIntBetween(0, 2)) { + case 0: + resizeType = ResizeType.SHRINK; + resizeShardsNum = 5; + cause = "shrink_index"; + break; + case 1: + resizeType = ResizeType.SPLIT; + resizeShardsNum = 20; + cause = "split_index"; + break; + default: + resizeType = ResizeType.CLONE; + resizeShardsNum = 10; + cause = "clone_index"; + } + + client.admin() + .indices() + .prepareUpdateSettings(TEST_INDEX) + .setSettings(Settings.builder().put("index.blocks.write", true)) + .execute() + .actionGet(); + + ensureGreen(TEST_INDEX); + + Settings.Builder resizeSettingsBuilder = Settings.builder() + .put("index.number_of_replicas", 0) + .put("index.number_of_shards", resizeShardsNum) + .putNull("index.blocks.write"); + + IllegalStateException ex = expectThrows( + IllegalStateException.class, + () -> client().admin() + .indices() + .prepareResizeIndex(TEST_INDEX, "first_split") + .setResizeType(resizeType) + .setSettings(resizeSettingsBuilder.build()) + .get() + ); + assertEquals( + ex.getMessage(), + "index Resizing for type [" + + resizeType + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [Remote Store]" + ); + } +} diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 6539aa75f7d8f..92e64efb53e03 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -58,9 +58,9 @@ import org.opensearch.index.IndexSettings; import org.opensearch.index.shard.DocsStats; import org.opensearch.index.store.StoreStats; +import org.opensearch.node.remotestore.RemoteStoreNodeService; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; -import org.opensearch.node.remotestore.RemoteStoreNodeService; import java.io.IOException; import java.util.Locale; @@ -164,7 +164,7 @@ protected void clusterManagerOperation( CreateIndexClusterStateUpdateRequest updateRequest = prepareCreateIndexRequest(resizeRequest, state, i -> { IndexShardStats shard = indicesStatsResponse.getIndex(sourceIndex).getIndexShards().get(i); return shard == null ? null : shard.getPrimary().getDocs(); - }, indicesStatsResponse.getPrimaries().store, clusterSettings,sourceIndex, targetIndex); + }, indicesStatsResponse.getPrimaries().store, clusterSettings, sourceIndex, targetIndex); if (indicesStatsResponse.getIndex(sourceIndex) .getTotal() @@ -235,7 +235,7 @@ static CreateIndexClusterStateUpdateRequest prepareCreateIndexRequest( if (metadata == null) { throw new IndexNotFoundException(sourceIndexName); } - validateClusterModeSettings(resizeRequest.getResizeType(),metadata,clusterSettings); + validateClusterModeSettings(resizeRequest.getResizeType(), metadata, clusterSettings); final Settings.Builder targetIndexSettingsBuilder = Settings.builder() .put(targetIndex.settings()) .normalizePrefix(IndexMetadata.INDEX_SETTING_PREFIX); @@ -374,15 +374,23 @@ protected String getClusterManagerActionName(DiscoveryNode node) { return super.getClusterManagerActionName(node); } - private static void validateClusterModeSettings(final ResizeType type,IndexMetadata sourceIndexMetadata,ClusterSettings clusterSettings) { - boolean isMixed = clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) + private static void validateClusterModeSettings( + final ResizeType type, + IndexMetadata sourceIndexMetadata, + ClusterSettings clusterSettings + ) { + boolean isMixed = clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) .equals(RemoteStoreNodeService.CompatibilityMode.MIXED); boolean isRemoteStoreMigrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) .equals(RemoteStoreNodeService.Direction.REMOTE_STORE); - boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); + boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); if (isMixed && isRemoteStoreMigrationDirection && !isRemoteStoreEnabled) { - throw new IllegalStateException("index Resizing for type [" + type + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [Remote Store]"); + throw new IllegalStateException( + "index Resizing for type [" + + type + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [Remote Store]" + ); } } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index 341e6843f05ea..20ffdac65636f 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -55,8 +55,6 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.FeatureFlags; import org.opensearch.core.common.unit.ByteSizeValue; -import org.opensearch.index.query.Rewriteable; -import org.opensearch.index.query.RewriteableTests; import org.opensearch.index.shard.DocsStats; import org.opensearch.index.store.StoreStats; import org.opensearch.node.remotestore.RemoteStoreNodeService; @@ -64,21 +62,18 @@ import org.opensearch.test.OpenSearchTestCase; import org.opensearch.test.gateway.TestGatewayAllocator; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.hamcrest.Matchers.*; -import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE_ENABLED; -import static org.opensearch.node.remotestore.RemoteStoreNodeService.CompatibilityMode; - - import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Set; import static java.util.Collections.emptyMap; +import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_REMOTE_STORE_ENABLED; +import static org.opensearch.common.util.FeatureFlags.REMOTE_STORE_MIGRATION_EXPERIMENTAL; +import static org.opensearch.node.remotestore.RemoteStoreNodeService.CompatibilityMode; import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING; import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING; -import static org.opensearch.common.util.FeatureFlags.REMOTE_STORE_MIGRATION_EXPERIMENTAL; +import static org.hamcrest.CoreMatchers.equalTo; public class TransportResizeActionTests extends OpenSearchTestCase { @@ -108,10 +103,14 @@ private ClusterState createClusterState(String name, int numShards, int numRepli return clusterState; } - private ClusterSettings createClusterSettings(CompatibilityMode compatibilityMode, RemoteStoreNodeService.Direction migrationDirection) { + private ClusterSettings createClusterSettings( + CompatibilityMode compatibilityMode, + RemoteStoreNodeService.Direction migrationDirection + ) { ClusterSettings clusterSettings = new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS); clusterSettings.applySettings( - (Settings.builder().put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), compatibilityMode) + (Settings.builder() + .put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), compatibilityMode) .put(MIGRATION_DIRECTION_SETTING.getKey(), migrationDirection)).build() ); return clusterSettings; @@ -124,7 +123,7 @@ public void testErrorCondition() { randomIntBetween(0, 10), Settings.builder().put("index.blocks.write", true).build() ); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); assertTrue( expectThrows( IllegalStateException.class, @@ -216,7 +215,7 @@ public void testPassNumRoutingShards() { EmptyClusterInfoService.INSTANCE, EmptySnapshotsInfoService.INSTANCE ); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -264,7 +263,7 @@ public void testPassNumRoutingShardsAndFail() { EmptySnapshotsInfoService.INSTANCE ); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -318,7 +317,7 @@ public void testShrinkIndexSettings() { EmptySnapshotsInfoService.INSTANCE ); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -360,7 +359,7 @@ public void testShrinkWithMaxShardSize() { EmptySnapshotsInfoService.INSTANCE ); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); RoutingTable routingTable = service.reroute(clusterState, "reroute").routingTable(); clusterState = ClusterState.builder(clusterState).routingTable(routingTable).build(); // now we start the shard @@ -516,7 +515,7 @@ public void testIndexBlocks() { createClusterState(indexName, 10, 0, 40, Settings.builder().put("index.blocks.read_only", true).build()) ).nodes(DiscoveryNodes.builder().add(newNode("node1"))).build(); - ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT,RemoteStoreNodeService.Direction.NONE); + ClusterSettings clusterSettings = createClusterSettings(CompatibilityMode.STRICT, RemoteStoreNodeService.Direction.NONE); // Target index will be blocked by [index.blocks.read_only=true] copied from the source index ResizeRequest resizeRequest = new ResizeRequest("target", indexName); ResizeType resizeType; @@ -604,24 +603,27 @@ public void testIndexBlocks() { } public void testResizeFailuresDuringMigration() { - //We will keep all other settings correct for resize request, - //So we only need to test for the failures due to cluster setting validation while migration + // We will keep all other settings correct for resize request, + // So we only need to test for the failures due to cluster setting validation while migration final Settings directionEnabledNodeSettings = Settings.builder().put(REMOTE_STORE_MIGRATION_EXPERIMENTAL, "true").build(); FeatureFlags.initializeFeatureFlags(directionEnabledNodeSettings); boolean isRemoteStoreEnabled = randomBoolean(); CompatibilityMode compatibilityMode = randomFrom(CompatibilityMode.values()); RemoteStoreNodeService.Direction migrationDirection = randomFrom(RemoteStoreNodeService.Direction.values()); - //If not mixed mode, then migration direction is NONE. - if(!compatibilityMode.equals(CompatibilityMode.MIXED)){ + // If not mixed mode, then migration direction is NONE. + if (!compatibilityMode.equals(CompatibilityMode.MIXED)) { migrationDirection = RemoteStoreNodeService.Direction.NONE; } - ClusterSettings clusterSettings = createClusterSettings(compatibilityMode,migrationDirection); + ClusterSettings clusterSettings = createClusterSettings(compatibilityMode, migrationDirection); ClusterState clusterState = ClusterState.builder( - createClusterState("source", 10, 0,40, - Settings.builder().put("index.blocks.write", true) - .put(SETTING_REMOTE_STORE_ENABLED, isRemoteStoreEnabled) - .build()) + createClusterState( + "source", + 10, + 0, + 40, + Settings.builder().put("index.blocks.write", true).put(SETTING_REMOTE_STORE_ENABLED, isRemoteStoreEnabled).build() + ) ).nodes(DiscoveryNodes.builder().add(newNode("node1"))).build(); AllocationService service = new AllocationService( new AllocationDeciders(Collections.singleton(new MaxRetryAllocationDecider())), @@ -662,14 +664,14 @@ public void testResizeFailuresDuringMigration() { .settings(Settings.builder().put("index.number_of_shards", expectedShardsNum).put("index.blocks.read_only", false).build()); final ActiveShardCount activeShardCount = randomBoolean() ? ActiveShardCount.ALL : ActiveShardCount.ONE; resizeRequest.setWaitForActiveShards(activeShardCount); - //startsWith("index Resizing for type [") + // startsWith("index Resizing for type [") if (compatibilityMode == CompatibilityMode.MIXED && migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE && !isRemoteStoreEnabled) { ClusterState finalState = clusterState; IllegalStateException ise = expectThrows( IllegalStateException.class, - () ->TransportResizeAction.prepareCreateIndexRequest( + () -> TransportResizeAction.prepareCreateIndexRequest( new ResizeRequest("target", "source"), finalState, (i) -> stats, @@ -679,12 +681,12 @@ public void testResizeFailuresDuringMigration() { "target" ) ); - assertThat( + assertEquals( ise.getMessage(), - allOf( - startsWith("index Resizing for type"), - endsWith("Cluster mode is [Mixed] and migration direction is [Remote Store]") - ) + "index Resizing for type [" + + resizeType + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [Remote Store]" ); } else { CreateIndexClusterStateUpdateRequest request = TransportResizeAction.prepareCreateIndexRequest( From f262296e1d55a5dd9d3d746fb3fd51ba2a16d034 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Mon, 1 Apr 2024 13:57:42 +0530 Subject: [PATCH 05/10] Addressed comments on PR by @gbbafna Signed-off-by: Shubh Sahu --- .../ResizeIndexMigrationTestCase.java | 97 ++++++++++++++++++- .../indices/shrink/TransportResizeAction.java | 30 +++--- .../shrink/TransportResizeActionTests.java | 60 ++++++++---- 3 files changed, 153 insertions(+), 34 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java index db5979143e4cc..b84d546d5d4f9 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -14,6 +14,7 @@ import org.opensearch.client.Client; import org.opensearch.common.settings.Settings; import org.opensearch.indices.replication.common.ReplicationType; +import org.opensearch.node.remotestore.RemoteStoreNodeService; import org.opensearch.test.OpenSearchIntegTestCase; import java.util.List; @@ -27,11 +28,12 @@ public class ResizeIndexMigrationTestCase extends MigrationBaseTestCase { private static final String TEST_INDEX = "test_index"; private final static String REMOTE_STORE_DIRECTION = "remote_store"; + private final static String DOC_REP_DIRECTION = "docrep"; private final static String NONE_DIRECTION = "none"; private final static String STRICT_MODE = "strict"; private final static String MIXED_MODE = "mixed"; - public void testFailResizeIndexWhileMigration() throws Exception { + public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Exception { internalCluster().setBootstrapClusterManagerNodeIndex(0); List cmNodes = internalCluster().startNodes(1); @@ -113,7 +115,98 @@ public void testFailResizeIndexWhileMigration() throws Exception { "index Resizing for type [" + resizeType + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [Remote Store]" + + " and migration direction is [REMOTE_STORE]" + + " and index's SETTING_REMOTE_STORE_ENABLED = " + + "false" + ); + } + + public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Exception { + + addRemote = true; + internalCluster().setBootstrapClusterManagerNodeIndex(0); + List cmNodes = internalCluster().startNodes(1); + Client client = internalCluster().client(cmNodes.get(0)); + ClusterUpdateSettingsRequest updateSettingsRequest = new ClusterUpdateSettingsRequest(); + updateSettingsRequest.persistentSettings(Settings.builder().put(REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey(), MIXED_MODE)); + assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + // Adding a non remote and a remote node + String remoteNodeName = internalCluster().startNode(); + + addRemote = false; + String nonRemoteNodeName = internalCluster().startNode(); + + + logger.info("-->Create index on remote node and SETTING_REMOTE_STORE_ENABLED is true. Resize should not happen"); + Settings.Builder builder = Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT); + client.admin() + .indices() + .prepareCreate(TEST_INDEX) + .setSettings( + builder.put("index.number_of_shards", 10) + .put("index.number_of_replicas", 0) + .put("index.routing.allocation.include._name", remoteNodeName) + .put("index.routing.allocation.exclude._name", nonRemoteNodeName) + ) + .setWaitForActiveShards(ActiveShardCount.ALL) + .execute() + .actionGet(); + + updateSettingsRequest.persistentSettings(Settings.builder().put(MIGRATION_DIRECTION_SETTING.getKey(), DOC_REP_DIRECTION)); + assertAcked(client.admin().cluster().updateSettings(updateSettingsRequest).actionGet()); + + ResizeType resizeType; + int resizeShardsNum; + String cause; + switch (randomIntBetween(0, 2)) { + case 0: + resizeType = ResizeType.SHRINK; + resizeShardsNum = 5; + cause = "shrink_index"; + break; + case 1: + resizeType = ResizeType.SPLIT; + resizeShardsNum = 20; + cause = "split_index"; + break; + default: + resizeType = ResizeType.CLONE; + resizeShardsNum = 10; + cause = "clone_index"; + } + + client.admin() + .indices() + .prepareUpdateSettings(TEST_INDEX) + .setSettings(Settings.builder().put("index.blocks.write", true)) + .execute() + .actionGet(); + + ensureGreen(TEST_INDEX); + + Settings.Builder resizeSettingsBuilder = Settings.builder() + .put("index.number_of_replicas", 0) + .put("index.number_of_shards", resizeShardsNum) + .putNull("index.blocks.write"); + + IllegalStateException ex = expectThrows( + IllegalStateException.class, + () -> client().admin() + .indices() + .prepareResizeIndex(TEST_INDEX, "first_split") + .setResizeType(resizeType) + .setSettings(resizeSettingsBuilder.build()) + .get() + ); + assertEquals( + ex.getMessage(), + "index Resizing for type [" + + resizeType + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [DOCREP]" + + " and index's SETTING_REMOTE_STORE_ENABLED = " + + "true" ); } } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 92e64efb53e03..5139e6a5c21b6 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -379,18 +379,24 @@ private static void validateClusterModeSettings( IndexMetadata sourceIndexMetadata, ClusterSettings clusterSettings ) { - boolean isMixed = clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) - .equals(RemoteStoreNodeService.CompatibilityMode.MIXED); - boolean isRemoteStoreMigrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) - .equals(RemoteStoreNodeService.Direction.REMOTE_STORE); - boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); - if (isMixed && isRemoteStoreMigrationDirection && !isRemoteStoreEnabled) { - throw new IllegalStateException( - "index Resizing for type [" - + type - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [Remote Store]" - ); + if (clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) + .equals(RemoteStoreNodeService.CompatibilityMode.MIXED)) { + boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); + if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.REMOTE_STORE) + && isRemoteStoreEnabled == false) + || (clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.DOCREP) + && isRemoteStoreEnabled == true)) { + throw new IllegalStateException( + "index Resizing for type [" + + type + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [" + + clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) + + "]" + + " and index's SETTING_REMOTE_STORE_ENABLED = " + + isRemoteStoreEnabled + ); + } } } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index 20ffdac65636f..fbec551317c47 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -664,30 +664,50 @@ public void testResizeFailuresDuringMigration() { .settings(Settings.builder().put("index.number_of_shards", expectedShardsNum).put("index.blocks.read_only", false).build()); final ActiveShardCount activeShardCount = randomBoolean() ? ActiveShardCount.ALL : ActiveShardCount.ONE; resizeRequest.setWaitForActiveShards(activeShardCount); - // startsWith("index Resizing for type [") - if (compatibilityMode == CompatibilityMode.MIXED - && migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE - && !isRemoteStoreEnabled) { - ClusterState finalState = clusterState; - IllegalStateException ise = expectThrows( - IllegalStateException.class, - () -> TransportResizeAction.prepareCreateIndexRequest( - new ResizeRequest("target", "source"), - finalState, + + if (compatibilityMode == CompatibilityMode.MIXED) { + if ((migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE && isRemoteStoreEnabled == false) + || migrationDirection == RemoteStoreNodeService.Direction.DOCREP && isRemoteStoreEnabled == true ){ + ClusterState finalState = clusterState; + IllegalStateException ise = expectThrows( + IllegalStateException.class, + () -> TransportResizeAction.prepareCreateIndexRequest( + resizeRequest, + finalState, + (i) -> stats, + new StoreStats(between(1, 10000), between(1, 10000)), + clusterSettings, + "source", + "target" + ) + ); + assertEquals( + ise.getMessage(), + "index Resizing for type [" + + resizeType + + "] is not allowed as Cluster mode is [Mixed]" + + " and migration direction is [" + + migrationDirection + + "]" + + " and index's SETTING_REMOTE_STORE_ENABLED = " + + isRemoteStoreEnabled + ); + } else { + CreateIndexClusterStateUpdateRequest request = TransportResizeAction.prepareCreateIndexRequest( + resizeRequest, + clusterState, (i) -> stats, - new StoreStats(between(1, 10000), between(1, 10000)), + new StoreStats(100, between(1, 10000)), clusterSettings, "source", "target" - ) - ); - assertEquals( - ise.getMessage(), - "index Resizing for type [" - + resizeType - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [Remote Store]" - ); + ); + assertNotNull(request.recoverFrom()); + assertEquals("source", request.recoverFrom().getName()); + assertEquals(String.valueOf(expectedShardsNum), request.settings().get("index.number_of_shards")); + assertEquals(cause, request.cause()); + assertEquals(request.waitForActiveShards(), activeShardCount); + } } else { CreateIndexClusterStateUpdateRequest request = TransportResizeAction.prepareCreateIndexRequest( resizeRequest, From 872f742886fcd06ba7b8afa9f34c07469690dfca Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Mon, 1 Apr 2024 15:43:10 +0530 Subject: [PATCH 06/10] code refactoring and spotless checks Signed-off-by: Shubh Sahu --- .../remotemigration/ResizeIndexMigrationTestCase.java | 2 -- .../action/admin/indices/shrink/TransportResizeAction.java | 5 +++-- .../admin/indices/shrink/TransportResizeActionTests.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java index b84d546d5d4f9..90e570a7367ae 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -14,7 +14,6 @@ import org.opensearch.client.Client; import org.opensearch.common.settings.Settings; import org.opensearch.indices.replication.common.ReplicationType; -import org.opensearch.node.remotestore.RemoteStoreNodeService; import org.opensearch.test.OpenSearchIntegTestCase; import java.util.List; @@ -137,7 +136,6 @@ public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Except addRemote = false; String nonRemoteNodeName = internalCluster().startNode(); - logger.info("-->Create index on remote node and SETTING_REMOTE_STORE_ENABLED is true. Resize should not happen"); Settings.Builder builder = Settings.builder().put(SETTING_REPLICATION_TYPE, ReplicationType.SEGMENT); client.admin() diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 5139e6a5c21b6..4faeceac4df8a 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -382,10 +382,11 @@ private static void validateClusterModeSettings( if (clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) .equals(RemoteStoreNodeService.CompatibilityMode.MIXED)) { boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); - if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.REMOTE_STORE) + if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) + .equals(RemoteStoreNodeService.Direction.REMOTE_STORE) && isRemoteStoreEnabled == false) || (clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.DOCREP) - && isRemoteStoreEnabled == true)) { + && isRemoteStoreEnabled == true)) { throw new IllegalStateException( "index Resizing for type [" + type diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index fbec551317c47..90ceace5c999a 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -667,7 +667,7 @@ public void testResizeFailuresDuringMigration() { if (compatibilityMode == CompatibilityMode.MIXED) { if ((migrationDirection == RemoteStoreNodeService.Direction.REMOTE_STORE && isRemoteStoreEnabled == false) - || migrationDirection == RemoteStoreNodeService.Direction.DOCREP && isRemoteStoreEnabled == true ){ + || migrationDirection == RemoteStoreNodeService.Direction.DOCREP && isRemoteStoreEnabled == true) { ClusterState finalState = clusterState; IllegalStateException ise = expectThrows( IllegalStateException.class, From 60c77eaf538a6baf6423fc0fbce9d1c028d05aa2 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Wed, 3 Apr 2024 01:57:02 +0530 Subject: [PATCH 07/10] Added javadoc and test descriptions Signed-off-by: Shubh Sahu --- .../ResizeIndexMigrationTestCase.java | 8 ++++++++ .../admin/indices/shrink/TransportResizeAction.java | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java index 90e570a7367ae..fb64254ca8f85 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -32,6 +32,10 @@ public class ResizeIndexMigrationTestCase extends MigrationBaseTestCase { private final static String STRICT_MODE = "strict"; private final static String MIXED_MODE = "mixed"; + /* + * This test will verify the resize request failure, when cluster mode is mixed + * and index is on DocRep node, and migration to remote store is in progress. + * */ public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Exception { internalCluster().setBootstrapClusterManagerNodeIndex(0); @@ -120,6 +124,10 @@ public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Except ); } + /* + * This test will verify the resize request failure, when cluster mode is mixed + * and index is on Remote Store node, and migration to DocRep node is in progress. + * */ public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Exception { addRemote = true; diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 4faeceac4df8a..360bb2602efb0 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -374,6 +374,18 @@ protected String getClusterManagerActionName(DiscoveryNode node) { return super.getClusterManagerActionName(node); } + /** + * Reject resize request if cluster mode is [Mixed] and migration direction is [RemoteStore] and index is not on + * REMOTE_STORE_ENABLED node or [DocRep] and index is on REMOTE_STORE_ENABLED node. + * @param type resize type + * @param sourceIndexMetadata source index's metadata + * @param clusterSettings cluster settings + * @throws IllegalStateException if cluster mode is [Mixed] and migration direction is [RemoteStore] or [DocRep] and + * index's SETTING_REMOTE_STORE_ENABLED is not equal to the migration direction's value. + * For example, if migration direction is [RemoteStore] and index's SETTING_REMOTE_STORE_ENABLED + * is false, then throw IllegalStateException. If migration direction is [DocRep] and + * index's SETTING_REMOTE_STORE_ENABLED is true, then throw IllegalStateException. + */ private static void validateClusterModeSettings( final ResizeType type, IndexMetadata sourceIndexMetadata, From da459ae8fd3ad8197fe8417ad7be3a3ebfbba0c2 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Thu, 4 Apr 2024 10:37:04 +0530 Subject: [PATCH 08/10] Refactoring the code Signed-off-by: Shubh Sahu --- .../ResizeIndexMigrationTestCase.java | 16 +++------- .../indices/shrink/TransportResizeAction.java | 30 ++++++++----------- .../shrink/TransportResizeActionTests.java | 11 ++----- 3 files changed, 20 insertions(+), 37 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java index fb64254ca8f85..d1122c1b2b109 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -115,12 +115,8 @@ public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Except ); assertEquals( ex.getMessage(), - "index Resizing for type [" - + resizeType - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [REMOTE_STORE]" - + " and index's SETTING_REMOTE_STORE_ENABLED = " - + "false" + "Index " + resizeType +" is not allowed as remote migration mode is mixed" + + " and index is remote store disabled" ); } @@ -207,12 +203,8 @@ public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Except ); assertEquals( ex.getMessage(), - "index Resizing for type [" - + resizeType - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [DOCREP]" - + " and index's SETTING_REMOTE_STORE_ENABLED = " - + "true" + "Index " + resizeType +" is not allowed as remote migration mode is mixed" + + " and index is remote store enabled" ); } } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 360bb2602efb0..47c4abb6624a8 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -59,6 +59,8 @@ import org.opensearch.index.shard.DocsStats; import org.opensearch.index.store.StoreStats; import org.opensearch.node.remotestore.RemoteStoreNodeService; +import org.opensearch.node.remotestore.RemoteStoreNodeService.CompatibilityMode; +import org.opensearch.node.remotestore.RemoteStoreNodeService.Direction; import org.opensearch.threadpool.ThreadPool; import org.opensearch.transport.TransportService; @@ -235,7 +237,7 @@ static CreateIndexClusterStateUpdateRequest prepareCreateIndexRequest( if (metadata == null) { throw new IndexNotFoundException(sourceIndexName); } - validateClusterModeSettings(resizeRequest.getResizeType(), metadata, clusterSettings); + validateRemoteMigrationModeSettings(resizeRequest.getResizeType(), metadata, clusterSettings); final Settings.Builder targetIndexSettingsBuilder = Settings.builder() .put(targetIndex.settings()) .normalizePrefix(IndexMetadata.INDEX_SETTING_PREFIX); @@ -386,28 +388,22 @@ protected String getClusterManagerActionName(DiscoveryNode node) { * is false, then throw IllegalStateException. If migration direction is [DocRep] and * index's SETTING_REMOTE_STORE_ENABLED is true, then throw IllegalStateException. */ - private static void validateClusterModeSettings( + private static void validateRemoteMigrationModeSettings( final ResizeType type, IndexMetadata sourceIndexMetadata, ClusterSettings clusterSettings ) { - if (clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING) - .equals(RemoteStoreNodeService.CompatibilityMode.MIXED)) { + CompatibilityMode compatibilityMode = clusterSettings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING); + if (compatibilityMode == CompatibilityMode.MIXED) { boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); - if ((clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) - .equals(RemoteStoreNodeService.Direction.REMOTE_STORE) - && isRemoteStoreEnabled == false) - || (clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING).equals(RemoteStoreNodeService.Direction.DOCREP) - && isRemoteStoreEnabled == true)) { + Direction migrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING); + boolean invalidConfiguration = (migrationDirection == Direction.REMOTE_STORE && isRemoteStoreEnabled == false) + || (migrationDirection == Direction.DOCREP && isRemoteStoreEnabled); + if (invalidConfiguration) { throw new IllegalStateException( - "index Resizing for type [" - + type - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [" - + clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING) - + "]" - + " and index's SETTING_REMOTE_STORE_ENABLED = " - + isRemoteStoreEnabled + "Index " + type +" is not allowed as remote migration mode is mixed" + + " and index is remote store " + + (isRemoteStoreEnabled ? "enabled" : "disabled") ); } } diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index 90ceace5c999a..8d4c0d7e7faf7 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -683,14 +683,9 @@ public void testResizeFailuresDuringMigration() { ); assertEquals( ise.getMessage(), - "index Resizing for type [" - + resizeType - + "] is not allowed as Cluster mode is [Mixed]" - + " and migration direction is [" - + migrationDirection - + "]" - + " and index's SETTING_REMOTE_STORE_ENABLED = " - + isRemoteStoreEnabled + "Index " + resizeType +" is not allowed as remote migration mode is mixed" + + " and index is remote store " + + (isRemoteStoreEnabled ? "enabled" : "disabled") ); } else { CreateIndexClusterStateUpdateRequest request = TransportResizeAction.prepareCreateIndexRequest( From df2aa339b118ba25361bcac4867da7d78019f175 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Thu, 4 Apr 2024 11:00:16 +0530 Subject: [PATCH 09/10] Spotless apply Signed-off-by: Shubh Sahu --- .../remotemigration/ResizeIndexMigrationTestCase.java | 6 ++---- .../action/admin/indices/shrink/TransportResizeAction.java | 6 ++++-- .../admin/indices/shrink/TransportResizeActionTests.java | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java index d1122c1b2b109..0548ce4a7955f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotemigration/ResizeIndexMigrationTestCase.java @@ -115,8 +115,7 @@ public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Except ); assertEquals( ex.getMessage(), - "Index " + resizeType +" is not allowed as remote migration mode is mixed" - + " and index is remote store disabled" + "Index " + resizeType + " is not allowed as remote migration mode is mixed" + " and index is remote store disabled" ); } @@ -203,8 +202,7 @@ public void testFailResizeIndexWhileRemoteStoreToDocRepMigration() throws Except ); assertEquals( ex.getMessage(), - "Index " + resizeType +" is not allowed as remote migration mode is mixed" - + " and index is remote store enabled" + "Index " + resizeType + " is not allowed as remote migration mode is mixed" + " and index is remote store enabled" ); } } diff --git a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java index 47c4abb6624a8..cb41325c18a22 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/shrink/TransportResizeAction.java @@ -397,11 +397,13 @@ private static void validateRemoteMigrationModeSettings( if (compatibilityMode == CompatibilityMode.MIXED) { boolean isRemoteStoreEnabled = sourceIndexMetadata.getSettings().getAsBoolean(SETTING_REMOTE_STORE_ENABLED, false); Direction migrationDirection = clusterSettings.get(RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING); - boolean invalidConfiguration = (migrationDirection == Direction.REMOTE_STORE && isRemoteStoreEnabled == false) + boolean invalidConfiguration = (migrationDirection == Direction.REMOTE_STORE && isRemoteStoreEnabled == false) || (migrationDirection == Direction.DOCREP && isRemoteStoreEnabled); if (invalidConfiguration) { throw new IllegalStateException( - "Index " + type +" is not allowed as remote migration mode is mixed" + "Index " + + type + + " is not allowed as remote migration mode is mixed" + " and index is remote store " + (isRemoteStoreEnabled ? "enabled" : "disabled") ); diff --git a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java index 8d4c0d7e7faf7..5bab2ceca0988 100644 --- a/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java +++ b/server/src/test/java/org/opensearch/action/admin/indices/shrink/TransportResizeActionTests.java @@ -683,7 +683,9 @@ public void testResizeFailuresDuringMigration() { ); assertEquals( ise.getMessage(), - "Index " + resizeType +" is not allowed as remote migration mode is mixed" + "Index " + + resizeType + + " is not allowed as remote migration mode is mixed" + " and index is remote store " + (isRemoteStoreEnabled ? "enabled" : "disabled") ); From 06ae8c0c7fb295f4b6e1db0719a5f644db446df7 Mon Sep 17 00:00:00 2001 From: Shubh Sahu Date: Thu, 4 Apr 2024 14:20:56 +0530 Subject: [PATCH 10/10] Corrected CHANGELOG.md Signed-off-by: Shubh Sahu --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8570360c77115..13241de0035aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Tracing for deep search path ([#12103](https://github.com/opensearch-project/OpenSearch/pull/12103)) - Add explicit dependency to validatePom and generatePom tasks ([#12807](https://github.com/opensearch-project/OpenSearch/pull/12807)) - Replace configureEach with all for publication iteration ([#12876](https://github.com/opensearch-project/OpenSearch/pull/12876)) -- Reject Resize index requests (i.e, split, shrink and clone), While DocRep to SegRep migration is in progress.([#12686](https://github.com/opensearch-project/OpenSearch/pull/12686)) ### Dependencies - Bump `log4j-core` from 2.18.0 to 2.19.0 @@ -114,6 +113,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Detect breaking changes on pull requests ([#9044](https://github.com/opensearch-project/OpenSearch/pull/9044)) - Add cluster primary balance contraint for rebalancing with buffer ([#12656](https://github.com/opensearch-project/OpenSearch/pull/12656)) - [Remote Store] Make translog transfer timeout configurable ([#12704](https://github.com/opensearch-project/OpenSearch/pull/12704)) +- Reject Resize index requests (i.e, split, shrink and clone), While DocRep to SegRep migration is in progress.([#12686](https://github.com/opensearch-project/OpenSearch/pull/12686)) ### Dependencies - Bump `org.apache.commons:commons-configuration2` from 2.10.0 to 2.10.1 ([#12896](https://github.com/opensearch-project/OpenSearch/pull/12896))