File tree 2 files changed +20
-0
lines changed
internalClusterTest/java/org/opensearch/remotemigration
main/java/org/opensearch/action/admin/indices/shrink
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ public class ResizeIndexMigrationTestCase extends MigrationBaseTestCase {
32
32
private final static String STRICT_MODE = "strict" ;
33
33
private final static String MIXED_MODE = "mixed" ;
34
34
35
+ /*
36
+ * This test will verify the resize request failure, when cluster mode is mixed
37
+ * and index is on DocRep node, and migration to remote store is in progress.
38
+ * */
35
39
public void testFailResizeIndexWhileDocRepToRemoteStoreMigration () throws Exception {
36
40
37
41
internalCluster ().setBootstrapClusterManagerNodeIndex (0 );
@@ -120,6 +124,10 @@ public void testFailResizeIndexWhileDocRepToRemoteStoreMigration() throws Except
120
124
);
121
125
}
122
126
127
+ /*
128
+ * This test will verify the resize request failure, when cluster mode is mixed
129
+ * and index is on Remote Store node, and migration to DocRep node is in progress.
130
+ * */
123
131
public void testFailResizeIndexWhileRemoteStoreToDocRepMigration () throws Exception {
124
132
125
133
addRemote = true ;
Original file line number Diff line number Diff line change @@ -374,6 +374,18 @@ protected String getClusterManagerActionName(DiscoveryNode node) {
374
374
return super .getClusterManagerActionName (node );
375
375
}
376
376
377
+ /**
378
+ * Reject resize request if cluster mode is [Mixed] and migration direction is [RemoteStore] and index is not on
379
+ * REMOTE_STORE_ENABLED node or [DocRep] and index is on REMOTE_STORE_ENABLED node.
380
+ * @param type resize type
381
+ * @param sourceIndexMetadata source index's metadata
382
+ * @param clusterSettings cluster settings
383
+ * @throws IllegalStateException if cluster mode is [Mixed] and migration direction is [RemoteStore] or [DocRep] and
384
+ * index's SETTING_REMOTE_STORE_ENABLED is not equal to the migration direction's value.
385
+ * For example, if migration direction is [RemoteStore] and index's SETTING_REMOTE_STORE_ENABLED
386
+ * is false, then throw IllegalStateException. If migration direction is [DocRep] and
387
+ * index's SETTING_REMOTE_STORE_ENABLED is true, then throw IllegalStateException.
388
+ */
377
389
private static void validateClusterModeSettings (
378
390
final ResizeType type ,
379
391
IndexMetadata sourceIndexMetadata ,
You can’t perform that action at this time.
0 commit comments