NSAmelchev commented on code in PR #11361:
URL: https://github.com/apache/ignite/pull/11361#discussion_r1633176147


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java:
##########
@@ -3895,20 +3879,22 @@ private Set<RemoteSnapshotFilesRecevier> activeTasks() {
                 else if (msg instanceof SnapshotFilesFailureMessage) {
                     SnapshotFilesFailureMessage respMsg0 = 
(SnapshotFilesFailureMessage)msg;
 
-                    RemoteSnapshotFilesRecevier task = active;
+                    synchronized (this) {
+                        RemoteSnapshotFilesRecevier task = active;

Review Comment:
   Fixed



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotRestoreFromRemoteTest.java:
##########
@@ -323,6 +326,48 @@ public void 
testSnapshotCachesStoppedIfLoadingFailOnRemote() throws Exception {
         ensureCacheAbsent(dfltCacheCfg);
     }
 
+    /** @throws Exception If failed. */
+    @Test
+    public void testRestoreConnectionLost() throws Exception {
+        IgniteEx coord = startDedicatedGrids(SECOND_CLUSTER_PREFIX, 2);
+
+        copyAndShuffle(snpParts, G.allGrids());
+
+        // Start a new node without snapshot working directory.
+        IgniteEx emptyNode = startDedicatedGrid(SECOND_CLUSTER_PREFIX, 2);
+
+        emptyNode.cluster().state(ClusterState.ACTIVE);
+
+        emptyNode.cache(DEFAULT_CACHE_NAME).destroy();
+
+        awaitPartitionMapExchange();
+
+        CountDownLatch latch = new CountDownLatch(1);
+
+        IgniteSnapshotManager mgr = snp(coord);
+
+        mgr.remoteSnapshotSenderFactory(new BiFunction<String, UUID, 
SnapshotSender>() {
+            @Override public SnapshotSender apply(String s, UUID uuid) {
+                return new DelegateSnapshotSender(log, 
mgr.snapshotExecutorService(), mgr.remoteSnapshotSenderFactory(s, uuid)) {
+                    @Override public void sendPart0(File part, String 
cacheDirName, GroupPartitionId pair, Long length) {
+                        delegate.sendPart0(part, cacheDirName, pair, length);
+
+                        latch.countDown();
+                    }
+                };
+            }
+        });
+
+        // Restore all cache groups.
+        IgniteFuture<Void> fut = 
emptyNode.snapshot().restoreSnapshot(SNAPSHOT_NAME, null);
+
+        latch.await(TIMEOUT, TimeUnit.MILLISECONDS);
+
+        coord.close();

Review Comment:
   Fixed



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to