Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject Resize index requests. (i.e, split, shrink and… #12686

Merged
merged 12 commits into from
Apr 4, 2024
Prev Previous commit
Next Next commit
code refactoring and spotless checks
Signed-off-by: Shubh Sahu <shubhvs@amazon.com>
  • Loading branch information
Shubh Sahu committed Apr 1, 2024
commit 872f742886fcd06ba7b8afa9f34c07469690dfca
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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,
Loading