File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
server/src/internalClusterTest/java/org/opensearch/remotestore Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1084,7 +1084,7 @@ public void testCloseIndexWithNoOpSyncAndFlushForAsyncTranslog() throws Interrup
1084
1084
1085
1085
public void testSuccessfulShallowV1SnapshotPostIndexClose () throws Exception {
1086
1086
internalCluster ().startClusterManagerOnlyNode ();
1087
- internalCluster ().startDataOnlyNodes (1 );
1087
+ String dataNode = internalCluster ().startDataOnlyNodes (1 ). get ( 0 );
1088
1088
createIndex (INDEX_NAME , remoteStoreIndexSettings (0 , 10000L , -1 ));
1089
1089
ensureGreen (INDEX_NAME );
1090
1090
@@ -1143,5 +1143,17 @@ public void testSuccessfulShallowV1SnapshotPostIndexClose() throws Exception {
1143
1143
assertEquals (SnapshotState .SUCCESS , snapshotInfo2 .state ());
1144
1144
assertTrue (snapshotInfo2 .successfulShards () > 0 );
1145
1145
assertEquals (0 , snapshotInfo2 .failedShards ());
1146
+
1147
+ // delete the index
1148
+ cluster ().wipeIndices (INDEX_NAME );
1149
+ // try restoring the snapshot
1150
+ RestoreSnapshotResponse restoreSnapshotResponse = clusterAdmin ().prepareRestoreSnapshot (shallowSnapshotRepoName , snapshot2 )
1151
+ .setWaitForCompletion (true )
1152
+ .execute ()
1153
+ .actionGet ();
1154
+ assertThat (restoreSnapshotResponse .getRestoreInfo ().totalShards (), greaterThan (0 ));
1155
+ ensureGreen (INDEX_NAME );
1156
+ flushAndRefresh (INDEX_NAME );
1157
+ assertBusy (() -> { assertHitCount (client (dataNode ).prepareSearch (INDEX_NAME ).setSize (0 ).get (), 20 ); });
1146
1158
}
1147
1159
}
You can’t perform that action at this time.
0 commit comments