|
@@ -1611,6 +1611,57 @@ public class ConcurrentSnapshotsIT extends AbstractSnapshotIntegTestCase {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ public void testIndexDeletedWhileSnapshotQueuedAfterClone() throws Exception {
|
|
|
+ final String master = internalCluster().startMasterOnlyNode(LARGE_SNAPSHOT_POOL_SETTINGS);
|
|
|
+ internalCluster().startDataOnlyNode();
|
|
|
+ final String index1 = "index-1";
|
|
|
+ final String index2 = "index-2";
|
|
|
+ createIndexWithContent(index1);
|
|
|
+ createIndexWithContent(index2);
|
|
|
+
|
|
|
+ final String repository = "test-repo";
|
|
|
+ createRepository(repository, "mock");
|
|
|
+
|
|
|
+ final String sourceSnapshot = "source-snapshot";
|
|
|
+ createFullSnapshot(repository, sourceSnapshot);
|
|
|
+
|
|
|
+ final IndexId index1Id = getRepositoryData(repository).resolveIndexId(index1);
|
|
|
+ blockMasterOnShardLevelSnapshotFile(repository, index1Id.getId());
|
|
|
+
|
|
|
+ final String cloneTarget = "target-snapshot";
|
|
|
+ final ActionFuture<AcknowledgedResponse> cloneSnapshot = clusterAdmin().prepareCloneSnapshot(
|
|
|
+ repository,
|
|
|
+ sourceSnapshot,
|
|
|
+ cloneTarget
|
|
|
+ ).setIndices(index1, index2).execute();
|
|
|
+ awaitNumberOfSnapshotsInProgress(1);
|
|
|
+ waitForBlock(master, repository);
|
|
|
+
|
|
|
+ final ActionFuture<CreateSnapshotResponse> snapshot3 = clusterAdmin().prepareCreateSnapshot(repository, "snapshot-3")
|
|
|
+ .setIndices(index1, index2)
|
|
|
+ .setWaitForCompletion(true)
|
|
|
+ .setPartial(true)
|
|
|
+ .execute();
|
|
|
+ final ActionFuture<CreateSnapshotResponse> snapshot2 = clusterAdmin().prepareCreateSnapshot(repository, "snapshot-2")
|
|
|
+ .setIndices(index2)
|
|
|
+ .setWaitForCompletion(true)
|
|
|
+ .execute();
|
|
|
+ assertSuccessful(snapshot2);
|
|
|
+ awaitNumberOfSnapshotsInProgress(2);
|
|
|
+ assertFalse(snapshot3.isDone());
|
|
|
+ assertAcked(admin().indices().prepareDelete(index1).get());
|
|
|
+ assertSuccessful(snapshot3);
|
|
|
+ unblockNode(repository, master);
|
|
|
+
|
|
|
+ assertAcked(cloneSnapshot.get());
|
|
|
+ assertAcked(startDeleteSnapshot(repository, cloneTarget).get());
|
|
|
+
|
|
|
+ assertThat(
|
|
|
+ clusterAdmin().prepareSnapshotStatus().setSnapshots("snapshot-2", "snapshot-3").setRepository(repository).get().getSnapshots(),
|
|
|
+ hasSize(2)
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
public void testQueuedAfterFailedShardSnapshot() throws Exception {
|
|
|
internalCluster().startMasterOnlyNode();
|
|
|
final String dataNode = internalCluster().startDataOnlyNode();
|