You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/12/20 21:03:56 UTC

[GitHub] [ignite] timoninmaxim opened a new pull request, #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

timoninmaxim opened a new pull request, #10454:
URL: https://github.com/apache/ignite/pull/10454

   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] timoninmaxim merged pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
timoninmaxim merged PR #10454:
URL: https://github.com/apache/ignite/pull/10454


-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054158790


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,31 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {

Review Comment:
   What if assert is disabled? Should we check directory is not deleted on client if exists?



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054157679


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,31 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {
+        Ignite ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
+
+        Ignite cln = startClientGrid();
+
+        TestRecordingCommunicationSpi failNodeSpi = TestRecordingCommunicationSpi.spi(grid(1));
+
+        failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage);
+
+        IgniteFuture<Void> fut = ignite.snapshot().createSnapshot(SNAPSHOT_NAME);
+
+        failNodeSpi.waitForBlocked(1, 10_000L);
+
+        grid(1).close();
+
+        assertThrowsAnyCause(log,
+            fut::get,
+            ClusterTopologyException.class,
+            "Snapshot operation interrupted, because baseline node left the cluster");
+
+        assertTrue(G.allGrids().contains(cln));

Review Comment:
   Test look flacky. Think we should wait for the client gone catching NODE_LEFT/NODE_FAILED event.



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054346687


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/AbstractSnapshotSelfTest.java:
##########
@@ -177,7 +178,8 @@ public static Collection<Boolean> encryptionParams() {
                 .setPageSize(DFLT_PAGE_SIZE))
             .setClusterStateOnStart(INACTIVE)
             .setIncludeEventTypes(EVTS_CLUSTER_SNAPSHOT)
-            .setDiscoverySpi(discoSpi);
+            .setDiscoverySpi(discoSpi)
+            .setFailureHandler(new StopNodeFailureHandler());

Review Comment:
   Should we raise this failure handler where needed only?



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054308042


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,32 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {
+        Ignite ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
+
+        Ignite cln = startClientGrid();
+
+        TestRecordingCommunicationSpi failNodeSpi = TestRecordingCommunicationSpi.spi(grid(1));
+
+        failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage);

Review Comment:
   To be sure: `failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage && ((SingleNodeMessage)msg).type() == START_SNAPSHOT.ordinal());` ?
   



##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,32 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {
+        Ignite ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
+
+        Ignite cln = startClientGrid();
+
+        TestRecordingCommunicationSpi failNodeSpi = TestRecordingCommunicationSpi.spi(grid(1));
+
+        failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage);

Review Comment:
   To be sure: `failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage && ((SingleNodeMessage)msg).type() == START_SNAPSHOT.ordinal());` ? WDYT
   



-- 
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-unsubscribe@ignite.apache.org

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


[GitHub] [ignite] Vladsz83 commented on a diff in pull request #10454: IGNITE-18436 Skip deleting snpshot files on client nodes

Posted by GitBox <gi...@apache.org>.
Vladsz83 commented on code in PR #10454:
URL: https://github.com/apache/ignite/pull/10454#discussion_r1054157679


##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteClusterSnapshotSelfTest.java:
##########
@@ -1224,6 +1224,31 @@ public void testClusterSnapshotFinishedTryCancel() throws Exception {
         assertSnapshotCacheKeys(snpIg.cache(dfltCacheCfg.getName()));
     }
 
+    /** @throws Exception If fails. */
+    @Test
+    public void testClientHandlesSnapshotFailOnStartStage() throws Exception {
+        Ignite ignite = startGridsWithCache(2, dfltCacheCfg, CACHE_KEYS_RANGE);
+
+        Ignite cln = startClientGrid();
+
+        TestRecordingCommunicationSpi failNodeSpi = TestRecordingCommunicationSpi.spi(grid(1));
+
+        failNodeSpi.blockMessages((n, msg) -> msg instanceof SingleNodeMessage);
+
+        IgniteFuture<Void> fut = ignite.snapshot().createSnapshot(SNAPSHOT_NAME);
+
+        failNodeSpi.waitForBlocked(1, 10_000L);
+
+        grid(1).close();
+
+        assertThrowsAnyCause(log,
+            fut::get,
+            ClusterTopologyException.class,
+            "Snapshot operation interrupted, because baseline node left the cluster");
+
+        assertTrue(G.allGrids().contains(cln));

Review Comment:
   Test look flacky. Think we should wait for the client gone catching NODE_LEFT/NODE_FAILED event.



-- 
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-unsubscribe@ignite.apache.org

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