|
34 | 34 | import java.util.concurrent.atomic.AtomicInteger; |
35 | 35 |
|
36 | 36 | import static java.util.Arrays.asList; |
| 37 | +import static org.opensearch.node.remotestore.RemoteStoreNodeService.MIGRATION_DIRECTION_SETTING; |
37 | 38 | import static org.opensearch.node.remotestore.RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING; |
38 | 39 | import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; |
39 | 40 |
|
@@ -87,6 +88,10 @@ public void testMixedModeRelocation() throws Exception { |
87 | 88 | int finalCurrentDoc1 = currentDoc; |
88 | 89 | waitUntil(() -> numAutoGenDocs.get() > finalCurrentDoc1 + 5); |
89 | 90 |
|
| 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 | + |
90 | 95 | logger.info("--> relocating from {} to {} ", docRepNode, remoteNode); |
91 | 96 | client().admin().cluster().prepareReroute().add(new MoveAllocationCommand("test", 0, docRepNode, remoteNode)).execute().actionGet(); |
92 | 97 | ClusterHealthResponse clusterHealthResponse = client().admin() |
@@ -170,6 +175,10 @@ public void testMixedModeRelocation_RemoteSeedingFail() throws Exception { |
170 | 175 | .setTransientSettings(Settings.builder().put(RecoverySettings.INDICES_INTERNAL_REMOTE_UPLOAD_TIMEOUT.getKey(), "10s")) |
171 | 176 | .get(); |
172 | 177 |
|
| 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 | + |
173 | 182 | logger.info("--> relocating from {} to {} ", docRepNode, remoteNode); |
174 | 183 | client().admin().cluster().prepareReroute().add(new MoveAllocationCommand("test", 0, docRepNode, remoteNode)).execute().actionGet(); |
175 | 184 | ClusterHealthResponse clusterHealthResponse = client().admin() |
|
0 commit comments