Skip to content

Commit e361cf1

Browse files
committed
Fix Failing ITs
Signed-off-by: Lakshya Taragi <lakshya.taragi@gmail.com>
1 parent 000d294 commit e361cf1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

server/src/internalClusterTest/java/org/opensearch/remotemigration/RemotePrimaryRelocationIT.java

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.concurrent.atomic.AtomicInteger;
3535

3636
import static java.util.Arrays.asList;
37+
import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING;
3738
import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING;
3839
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
3940

@@ -87,6 +88,10 @@ public void testMixedModeRelocation() throws Exception {
8788
int finalCurrentDoc1 = currentDoc;
8889
waitUntil(() -> numAutoGenDocs.get() > finalCurrentDoc1 + 5);
8990

91+
// Change direction to remote store
92+
updateSettingsRequest.persistentSettings(Settings.builder().put(MIGRATION_DIRECTION_SETTING.getKey(), "remote_store"));
93+
assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet());
94+
9095
logger.info("--> relocating from {} to {} ", docRepNode, remoteNode);
9196
client().admin().cluster().prepareReroute().add(new MoveAllocationCommand("test", 0, docRepNode, remoteNode)).execute().actionGet();
9297
ClusterHealthResponse clusterHealthResponse = client().admin()
@@ -170,6 +175,10 @@ public void testMixedModeRelocation_RemoteSeedingFail() throws Exception {
170175
.setTransientSettings(Settings.builder().put(RecoverySettings.INDICES_INTERNAL_REMOTE_UPLOAD_TIMEOUT.getKey(), "10s"))
171176
.get();
172177

178+
// Change direction to remote store
179+
updateSettingsRequest.persistentSettings(Settings.builder().put(MIGRATION_DIRECTION_SETTING.getKey(), "remote_store"));
180+
assertAcked(client().admin().cluster().updateSettings(updateSettingsRequest).actionGet());
181+
173182
logger.info("--> relocating from {} to {} ", docRepNode, remoteNode);
174183
client().admin().cluster().prepareReroute().add(new MoveAllocationCommand("test", 0, docRepNode, remoteNode)).execute().actionGet();
175184
ClusterHealthResponse clusterHealthResponse = client().admin()

0 commit comments

Comments
 (0)