|
@@ -136,10 +136,10 @@ public class MultiVersionRepositoryAccessIT extends ESRestTestCase {
|
|
|
break;
|
|
|
}
|
|
|
if (TEST_STEP == TestStep.STEP3_OLD_CLUSTER) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards, index);
|
|
|
} else if (TEST_STEP == TestStep.STEP4_NEW_CLUSTER) {
|
|
|
for (TestStep value : TestStep.values()) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + value, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + value, shards, index);
|
|
|
}
|
|
|
}
|
|
|
} finally {
|
|
@@ -176,10 +176,10 @@ public class MultiVersionRepositoryAccessIT extends ESRestTestCase {
|
|
|
"snapshot-" + TestStep.STEP1_OLD_CLUSTER, "snapshot-" + TestStep.STEP2_NEW_CLUSTER);
|
|
|
}
|
|
|
if (TEST_STEP == TestStep.STEP3_OLD_CLUSTER) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards, index);
|
|
|
} else if (TEST_STEP == TestStep.STEP4_NEW_CLUSTER) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards);
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP2_NEW_CLUSTER, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards, index);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP2_NEW_CLUSTER, shards, index);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -212,15 +212,15 @@ public class MultiVersionRepositoryAccessIT extends ESRestTestCase {
|
|
|
assertSnapshotStatusSuccessful(client, repoName,
|
|
|
snapshots.stream().map(sn -> (String) sn.get("snapshot")).toArray(String[]::new));
|
|
|
if (TEST_STEP == TestStep.STEP1_OLD_CLUSTER) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER, shards, index);
|
|
|
} else {
|
|
|
deleteSnapshot(client, repoName, "snapshot-" + TestStep.STEP1_OLD_CLUSTER);
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP2_NEW_CLUSTER, shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-" + TestStep.STEP2_NEW_CLUSTER, shards, index);
|
|
|
createSnapshot(client, repoName, "snapshot-1", index);
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-1", shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-1", shards, index);
|
|
|
deleteSnapshot(client, repoName, "snapshot-" + TestStep.STEP2_NEW_CLUSTER);
|
|
|
createSnapshot(client, repoName, "snapshot-2", index);
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-2", shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-2", shards, index);
|
|
|
}
|
|
|
} else {
|
|
|
if (SnapshotsService.includesUUIDs(minNodeVersion) == false) {
|
|
@@ -232,8 +232,8 @@ public class MultiVersionRepositoryAccessIT extends ESRestTestCase {
|
|
|
} else {
|
|
|
assertThat(listSnapshots(repoName), hasSize(2));
|
|
|
if (TEST_STEP == TestStep.STEP4_NEW_CLUSTER) {
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-1", shards);
|
|
|
- ensureSnapshotRestoreWorks(client, repoName, "snapshot-2", shards);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-1", shards, index);
|
|
|
+ ensureSnapshotRestoreWorks(client, repoName, "snapshot-2", shards, index);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -272,10 +272,11 @@ public class MultiVersionRepositoryAccessIT extends ESRestTestCase {
|
|
|
}
|
|
|
|
|
|
private static void ensureSnapshotRestoreWorks(RestHighLevelClient client, String repoName, String name,
|
|
|
- int shards) throws IOException {
|
|
|
+ int shards, String index) throws IOException {
|
|
|
wipeAllIndices();
|
|
|
final RestoreInfo restoreInfo =
|
|
|
- client.snapshot().restore(new RestoreSnapshotRequest().repository(repoName).snapshot(name).waitForCompletion(true),
|
|
|
+ client.snapshot().restore(
|
|
|
+ new RestoreSnapshotRequest().repository(repoName).snapshot(name).indices(index).waitForCompletion(true),
|
|
|
RequestOptions.DEFAULT).getRestoreInfo();
|
|
|
assertThat(restoreInfo.failedShards(), is(0));
|
|
|
assertThat(restoreInfo.successfulShards(), equalTo(shards));
|