|
12 | 12 | import org.opensearch.action.admin.cluster.remotestore.restore.RestoreRemoteStoreRequest;
|
13 | 13 | import org.opensearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
|
14 | 14 | import org.opensearch.action.admin.indices.delete.DeleteIndexRequest;
|
| 15 | +import org.opensearch.action.admin.indices.recovery.RecoveryResponse; |
15 | 16 | import org.opensearch.action.delete.DeleteResponse;
|
16 | 17 | import org.opensearch.action.support.PlainActionFuture;
|
17 | 18 | import org.opensearch.client.Client;
|
|
31 | 32 | import org.opensearch.index.remote.RemoteStoreEnums.PathType;
|
32 | 33 | import org.opensearch.index.shard.IndexShard;
|
33 | 34 | import org.opensearch.indices.IndicesService;
|
| 35 | +import org.opensearch.indices.recovery.RecoveryState; |
34 | 36 | import org.opensearch.indices.replication.common.ReplicationType;
|
35 | 37 | import org.opensearch.snapshots.AbstractSnapshotIntegTestCase;
|
36 | 38 | import org.opensearch.snapshots.SnapshotInfo;
|
@@ -579,6 +581,24 @@ public void testRestoreShallowSnapshotRepository() throws ExecutionException, In
|
579 | 581 | ensureGreen(restoredIndexName1);
|
580 | 582 | assertDocsPresentInIndex(client, restoredIndexName1, numDocsInIndex1);
|
581 | 583 |
|
| 584 | + // ensure recovery details are non-zero |
| 585 | + RecoveryResponse recoveryResponse = client().admin().indices().prepareRecoveries(restoredIndexName1).execute().actionGet(); |
| 586 | + for (Map.Entry<String, List<RecoveryState>> entry : recoveryResponse.shardRecoveryStates().entrySet()) { |
| 587 | + for (RecoveryState recoveryState : entry.getValue()) { |
| 588 | + // ensure populated file details |
| 589 | + assertThat(recoveryState.getIndex().totalFileCount(), greaterThan(0)); |
| 590 | + assertThat(recoveryState.getIndex().totalRecoverFiles(), greaterThan(0)); |
| 591 | + assertThat(recoveryState.getIndex().recoveredFileCount(), greaterThan(0)); |
| 592 | + assertThat(recoveryState.getIndex().recoveredFilesPercent(), greaterThan(0f)); |
| 593 | + |
| 594 | + // ensure populated bytes details |
| 595 | + assertThat(recoveryState.getIndex().recoveredBytes(), greaterThan(0L)); |
| 596 | + assertThat(recoveryState.getIndex().totalBytes(), greaterThan(0L)); |
| 597 | + assertThat(recoveryState.getIndex().totalRecoverBytes(), greaterThan(0L)); |
| 598 | + assertThat(recoveryState.getIndex().recoveredBytesPercent(), greaterThan(0f)); |
| 599 | + } |
| 600 | + } |
| 601 | + |
582 | 602 | // indexing some new docs and validating
|
583 | 603 | indexDocuments(client, restoredIndexName1, numDocsInIndex1, numDocsInIndex1 + 2);
|
584 | 604 | ensureGreen(restoredIndexName1);
|
|
0 commit comments