diff --git a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java index b8f03a822b51f..56b32b56041ef 100644 --- a/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/remotestore/RemoteRestoreSnapshotIT.java @@ -938,18 +938,14 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio Thread thread = new Thread(() -> { try { String snapshotName = "snapshot-concurrent-" + snapshotIndex; - CreateSnapshotResponse createSnapshotResponse2 = client().admin() + client().admin() .cluster() .prepareCreateSnapshot(snapshotRepoName, snapshotName) .setWaitForCompletion(true) .get(); - SnapshotInfo snapshotInfo = createSnapshotResponse2.getSnapshotInfo(); - assertThat(snapshotInfo.state(), equalTo(SnapshotState.SUCCESS)); - assertThat(snapshotInfo.successfulShards(), greaterThan(0)); - assertThat(snapshotInfo.successfulShards(), equalTo(snapshotInfo.totalShards())); - assertThat(snapshotInfo.snapshotId().getName(), equalTo(snapshotName)); - assertThat(snapshotInfo.getPinnedTimestamp(), greaterThan(0L)); - } catch (Exception e) {} + logger.info("Snapshot completed {}", snapshotName); + } catch (Exception e) { + } }); threads.add(thread); } @@ -963,8 +959,8 @@ public void testConcurrentSnapshotV2CreateOperation() throws InterruptedExceptio thread.join(); } + Thread.sleep(10000); client().admin().cluster().prepareCreateSnapshot(snapshotRepoName, "snapshot-cleanup-timestamp").setWaitForCompletion(true).get(); - // Validate that only one snapshot has been created Repository repository = internalCluster().getInstance(RepositoriesService.class).repository(snapshotRepoName); PlainActionFuture repositoryDataPlainActionFuture = new PlainActionFuture<>(); repository.getRepositoryData(repositoryDataPlainActionFuture); diff --git a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java index 7832a5a19036f..61f495c66c782 100644 --- a/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java +++ b/server/src/main/java/org/opensearch/snapshots/SnapshotsService.java @@ -618,6 +618,7 @@ public void onResponse(RepositoryData repositoryData) { return; } listener.onResponse(snapshotInfo); + logger.info("[{}] created snapshot-v2 [{}]", repositoryName, snapshotName); // For snapshot-v2, we don't allow concurrent snapshots . But meanwhile non-v2 snapshot operations // can get queued . This is triggering them. runNextQueuedOperation(repositoryData, repositoryName, true); @@ -2216,12 +2217,14 @@ private void runNextQueuedOperation(RepositoryData repositoryData, String reposi final Tuple nextFinalization = repositoryOperations.pollFinalization(repository); if (nextFinalization == null) { if (attemptDelete) { + logger.info("Attempting delete now runNextQueuedOperation"); runReadyDeletions(repositoryData, repository); } else { + logger.info("Leaving repo loop from runNextQueuedOperation"); leaveRepoLoop(repository); } } else { - logger.trace("Moving on to finalizing next snapshot [{}]", nextFinalization); + logger.info("Moving on to finalizing next snapshot [{}]", nextFinalization); finalizeSnapshotEntry(nextFinalization.v1(), nextFinalization.v2(), repositoryData); } }