Skip to content

Commit

Permalink
Added javadoc and test descriptions
Browse files Browse the repository at this point in the history
Signed-off-by: Shubh Sahu <[email protected]>
  • Loading branch information
Shubh Sahu committed Apr 2, 2024
1 parent 872f742 commit abf1be0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit abf1be0

Please sign in to comment.