@@ -819,6 +819,28 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception {
819
819
assertAcked (deleteFuture .get ());
820
820
}
821
821
822
+ public void testMultiplePartialSnapshotsQueuedAfterDelete () throws Exception {
823
+ final String masterNode = internalCluster ().startMasterOnlyNode ();
824
+ internalCluster ().startDataOnlyNode ();
825
+ final String repoName = "test-repo" ;
826
+ createRepository (repoName , "mock" );
827
+ createIndexWithContent ("index-one" );
828
+ createIndexWithContent ("index-two" );
829
+ createNSnapshots (repoName , randomIntBetween (1 , 5 ));
830
+
831
+ final ActionFuture <AcknowledgedResponse > deleteFuture = startAndBlockOnDeleteSnapshot (repoName , "*" );
832
+ final ActionFuture <CreateSnapshotResponse > snapshotThree = startFullSnapshot (repoName , "snapshot-three" , true );
833
+ final ActionFuture <CreateSnapshotResponse > snapshotFour = startFullSnapshot (repoName , "snapshot-four" , true );
834
+ awaitNSnapshotsInProgress (2 );
835
+
836
+ assertAcked (client ().admin ().indices ().prepareDelete ("index-two" ));
837
+ unblockNode (repoName , masterNode );
838
+
839
+ assertThat (snapshotThree .get ().getSnapshotInfo ().state (), is (SnapshotState .PARTIAL ));
840
+ assertThat (snapshotFour .get ().getSnapshotInfo ().state (), is (SnapshotState .PARTIAL ));
841
+ assertAcked (deleteFuture .get ());
842
+ }
843
+
822
844
public void testQueuedSnapshotsWaitingForShardReady () throws Exception {
823
845
internalCluster ().startMasterOnlyNode ();
824
846
internalCluster ().startDataOnlyNodes (2 );
@@ -1238,8 +1260,13 @@ private ActionFuture<CreateSnapshotResponse> startFullSnapshotFromMasterClient(S
1238
1260
}
1239
1261
1240
1262
private ActionFuture <CreateSnapshotResponse > startFullSnapshot (String repoName , String snapshotName ) {
1263
+ return startFullSnapshot (repoName , snapshotName , false );
1264
+ }
1265
+
1266
+ private ActionFuture <CreateSnapshotResponse > startFullSnapshot (String repoName , String snapshotName , boolean partial ) {
1241
1267
logger .info ("--> creating full snapshot [{}] to repo [{}]" , snapshotName , repoName );
1242
- return client ().admin ().cluster ().prepareCreateSnapshot (repoName , snapshotName ).setWaitForCompletion (true ).execute ();
1268
+ return client ().admin ().cluster ().prepareCreateSnapshot (repoName , snapshotName ).setWaitForCompletion (true )
1269
+ .setPartial (partial ).execute ();
1243
1270
}
1244
1271
1245
1272
private void awaitClusterState (Predicate <ClusterState > statePredicate ) throws Exception {
0 commit comments