|
|
@@ -124,6 +124,8 @@ public class IndexSnapshotsServiceIT extends AbstractSnapshotIntegTestCase {
|
|
|
List<String> indices = List.of(indexName, indexName2);
|
|
|
createIndex(indexName, indexName2);
|
|
|
SnapshotInfo lastSnapshot = null;
|
|
|
+ String expectedIndexMetadataId = null;
|
|
|
+
|
|
|
int numSnapshots = randomIntBetween(5, 25);
|
|
|
for (int i = 0; i < numSnapshots; i++) {
|
|
|
if (randomBoolean()) {
|
|
|
@@ -134,6 +136,9 @@ public class IndexSnapshotsServiceIT extends AbstractSnapshotIntegTestCase {
|
|
|
final SnapshotInfo snapshotInfo = createSnapshot(repoName, String.format(Locale.ROOT, "snap-%03d", i), snapshotIndices);
|
|
|
if (snapshotInfo.indices().contains(indexName)) {
|
|
|
lastSnapshot = snapshotInfo;
|
|
|
+ ClusterStateResponse clusterStateResponse = admin().cluster().prepareState().execute().actionGet();
|
|
|
+ IndexMetadata indexMetadata = clusterStateResponse.getState().metadata().index(indexName);
|
|
|
+ expectedIndexMetadataId = IndexMetaDataGenerations.buildUniqueIdentifier(indexMetadata);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -151,10 +156,7 @@ public class IndexSnapshotsServiceIT extends AbstractSnapshotIntegTestCase {
|
|
|
|
|
|
final ShardSnapshotInfo shardSnapshotInfo = indexShardSnapshotInfoOpt.get();
|
|
|
|
|
|
- final ClusterStateResponse clusterStateResponse = admin().cluster().prepareState().execute().actionGet();
|
|
|
- final IndexMetadata indexMetadata = clusterStateResponse.getState().metadata().index(indexName);
|
|
|
- final String indexMetadataId = IndexMetaDataGenerations.buildUniqueIdentifier(indexMetadata);
|
|
|
- assertThat(shardSnapshotInfo.getIndexMetadataIdentifier(), equalTo(indexMetadataId));
|
|
|
+ assertThat(shardSnapshotInfo.getIndexMetadataIdentifier(), equalTo(expectedIndexMetadataId));
|
|
|
|
|
|
final Snapshot snapshot = shardSnapshotInfo.getSnapshot();
|
|
|
assertThat(snapshot, equalTo(lastSnapshot.snapshot()));
|