@@ -819,6 +819,28 @@ public void testMultipleSnapshotsQueuedAfterDelete() throws Exception {
819819 assertAcked (deleteFuture .get ());
820820 }
821821
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+
822844 public void testQueuedSnapshotsWaitingForShardReady () throws Exception {
823845 internalCluster ().startMasterOnlyNode ();
824846 internalCluster ().startDataOnlyNodes (2 );
@@ -1238,8 +1260,13 @@ private ActionFuture<CreateSnapshotResponse> startFullSnapshotFromMasterClient(S
12381260 }
12391261
12401262 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 ) {
12411267 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 ();
12431270 }
12441271
12451272 private void awaitClusterState (Predicate <ClusterState > statePredicate ) throws Exception {
0 commit comments