Search in sources :

Example 1 with UncategorizedExecutionException

use of org.opensearch.common.util.concurrent.UncategorizedExecutionException in project OpenSearch by opensearch-project.

the class ConcurrentSnapshotsIT method testSnapshotRunsAfterInProgressDelete.

public void testSnapshotRunsAfterInProgressDelete() throws Exception {
    final String clusterManagerNode = internalCluster().startClusterManagerOnlyNode();
    internalCluster().startDataOnlyNode();
    final String repoName = "test-repo";
    createRepository(repoName, "mock");
    ensureGreen();
    createIndexWithContent("index-test");
    final String firstSnapshot = "first-snapshot";
    createFullSnapshot(repoName, firstSnapshot);
    blockMasterFromFinalizingSnapshotOnIndexFile(repoName);
    final ActionFuture<AcknowledgedResponse> deleteFuture = startDeleteSnapshot(repoName, firstSnapshot);
    waitForBlock(clusterManagerNode, repoName, TimeValue.timeValueSeconds(30L));
    final ActionFuture<CreateSnapshotResponse> snapshotFuture = startFullSnapshot(repoName, "second-snapshot");
    unblockNode(repoName, clusterManagerNode);
    final UncategorizedExecutionException ex = expectThrows(UncategorizedExecutionException.class, deleteFuture::actionGet);
    assertThat(ex.getRootCause(), instanceOf(IOException.class));
    assertSuccessful(snapshotFuture);
}
Also used : CreateSnapshotResponse(org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse) AcknowledgedResponse(org.opensearch.action.support.master.AcknowledgedResponse) Matchers.containsString(org.hamcrest.Matchers.containsString) UncategorizedExecutionException(org.opensearch.common.util.concurrent.UncategorizedExecutionException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 CreateSnapshotResponse (org.opensearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse)1 AcknowledgedResponse (org.opensearch.action.support.master.AcknowledgedResponse)1 UncategorizedExecutionException (org.opensearch.common.util.concurrent.UncategorizedExecutionException)1