This is an automated email from the ASF dual-hosted git repository.

alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 89c93583c40 IGNITE-22707 Fix node failure when runtime exception 
occurs on snapshot start stage (#11430)
89c93583c40 is described below

commit 89c93583c40eba3bb2cb71362cf049ff44f16356
Author: Aleksey Plekhanov <[email protected]>
AuthorDate: Thu Jul 11 18:10:40 2024 +0300

    IGNITE-22707 Fix node failure when runtime exception occurs on snapshot 
start stage (#11430)
---
 .../internal/processors/pool/PoolProcessor.java    |  2 +-
 .../snapshot/IgniteClusterSnapshotSelfTest.java    | 30 ++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
index f40d33ce663..704067ca228 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/pool/PoolProcessor.java
@@ -524,7 +524,7 @@ public class PoolProcessor extends GridProcessorAdapter {
             DFLT_THREAD_KEEP_ALIVE_TIME,
             new LinkedBlockingQueue<>(),
             GridIoPolicy.UNDEFINED,
-            excHnd);
+            oomeHnd);
 
         snpExecSvc.allowCoreThreadTimeOut(true);
 
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
index b95452fc6f5..25021b2fe83 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java
@@ -120,6 +120,14 @@ public class IgniteClusterSnapshotSelfTest extends 
AbstractSnapshotSelfTest {
     /** {@code true} if node should be started in separate jvm. */
     protected volatile boolean jvm;
 
+    /** Any node failed. */
+    private boolean failed;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        return 
super.getConfiguration(igniteInstanceName).setFailureHandler((ignite, ctx) -> 
failed = true);
+    }
+
     /** @throws Exception If fails. */
     @Before
     @Override public void beforeTestSnapshot() throws Exception {
@@ -564,6 +572,28 @@ public class IgniteClusterSnapshotSelfTest extends 
AbstractSnapshotSelfTest {
         }
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testExceptionOnStartStage() throws Exception {
+        IgniteEx ignite = startGridsWithCache(2, dfltCacheCfg, 
CACHE_KEYS_RANGE);
+
+        IgniteFuture<Void> fut = snp(ignite).createSnapshot(SNAPSHOT_NAME, 
null, false, onlyPrimary);
+
+        File snpDir = snp(ignite).snapshotLocalDir(SNAPSHOT_NAME);
+
+        assertTrue(snpDir.mkdirs());
+
+        File snpMeta = new File(snpDir, 
IgniteSnapshotManager.snapshotMetaFileName(ignite.localNode().consistentId().toString()));
+
+        assertTrue(snpMeta.createNewFile());
+
+        assertThrowsAnyCause(log, fut::get, IgniteException.class, "Snapshot 
metafile must not exist");
+
+        assertFalse(failed);
+
+        createAndCheckSnapshot(ignite, SNAPSHOT_NAME);
+    }
+
     /** @throws Exception If fails. */
     @Test
     public void testSnapshotExistsException() throws Exception {

Reply via email to