Vladsz83 commented on code in PR #13577:
URL: https://github.com/apache/ignite/pull/13577#discussion_r4296773981


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotRestoreSelfTest.java:
##########
@@ -333,6 +333,47 @@ public void testCreateSnapshotDuringRestore() throws 
Exception {
         assertCacheKeys(ignite.cache(DEFAULT_CACHE_NAME), CACHE_KEYS_RANGE);
     }
 
+    /** Tests that snapshot restore is declined when the same snapshot is 
being deleted. */
+    @Test
+    public void testConcurrentSnapshotDeleteAndRestoreOperations() throws 
Exception {
+        String snapshotName = caseInsensitiveFs ? SNAPSHOT_NAME.toLowerCase() 
: SNAPSHOT_NAME;
+
+        doConcurrentSnapshotOperationWhenDeletionIsActive(
+            () -> startGridsWithSnapshot(3, CACHE_KEYS_RANGE),
+            () -> snp(grid(2)).restoreSnapshot(snapshotName, null).get(),
+            e -> e.getMessage().contains("Snapshot '%s' is being 
deleted".formatted(snapshotName)),
+            true
+        );
+    }
+
+    /** */
+    @Test
+    public void 
testConcurrentSnapshotDeleteAndRestoreOperationsWithDifferentPath() throws 
Exception {
+        String snpPath = new File(U.defaultWorkDirectory(), 
"ex_snapshots").getAbsolutePath();
+
+        doConcurrentSnapshotOperationWhenDeletionIsActive(
+            () -> {
+                startGridsWithSnapshot(3, CACHE_KEYS_RANGE);
+
+                grid(0).createCache(DEFAULT_CACHE_NAME);
+
+                try (var ds = grid(0).dataStreamer(DEFAULT_CACHE_NAME)) {

Review Comment:
   Done (will push later).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to