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/06/03 15:28:00 UTC

[GitHub] [ignite-3] sashapolo opened a new pull request, #853: IGNITE-17100 Make JoinReady command idempotent

sashapolo opened a new pull request, #853:
URL: https://github.com/apache/ignite-3/pull/853

   https://issues.apache.org/jira/browse/IGNITE-17100


-- 
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-3] sashapolo commented on a diff in pull request #853: IGNITE-17100 Make JoinReady command idempotent

Posted by GitBox <gi...@apache.org>.
sashapolo commented on code in PR #853:
URL: https://github.com/apache/ignite-3/pull/853#discussion_r889170943


##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+    }

Review Comment:
   I don't know, it shouldn't happen in a normal case scenario...



-- 
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-3] SammyVimes merged pull request #853: IGNITE-17100 Make JoinReady command idempotent

Posted by GitBox <gi...@apache.org>.
SammyVimes merged PR #853:
URL: https://github.com/apache/ignite-3/pull/853


-- 
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-3] sashapolo commented on a diff in pull request #853: IGNITE-17100 Make JoinReady command idempotent

Posted by GitBox <gi...@apache.org>.
sashapolo commented on code in PR #853:
URL: https://github.com/apache/ignite-3/pull/853#discussion_r889169193


##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());

Review Comment:
   I just wanted to verify that there's no state behind the start, so I execute the completion phase 1 time more



-- 
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-3] rpuch commented on a diff in pull request #853: IGNITE-17100 Make JoinReady command idempotent

Posted by GitBox <gi...@apache.org>.
rpuch commented on code in PR #853:
URL: https://github.com/apache/ignite-3/pull/853#discussion_r889137576


##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());

Review Comment:
   Why is completion tried 3 times, while start is only tried 2 times?



##########
modules/cluster-management/src/integrationTest/java/org/apache/ignite/internal/cluster/management/raft/ItCmgRaftServiceTest.java:
##########
@@ -471,4 +468,31 @@ void testClusterStateValidation() {
                 )
         );
     }
+
+    /**
+     * Tests that {@link JoinRequestCommand} and {@link JoinReadyCommand} are idempotent.
+     */
+    @Test
+    void testJoinCommandsIdempotence() {
+        ClusterState state = new ClusterState(
+                List.of("foo"),
+                List.of("bar"),
+                IgniteProductVersion.CURRENT_VERSION,
+                new ClusterTag("cluster")
+        );
+
+        assertThat(cluster.get(0).raftService.initClusterState(state), willCompleteSuccessfully());
+
+        CmgRaftService service = cluster.get(1).raftService;
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.startJoinCluster(state.clusterTag()), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+
+        assertThat(service.completeJoinCluster(), willCompleteSuccessfully());
+    }

Review Comment:
   Does it make sense to also check how `startJoinCluster()` works AFTER `completeJoinCluster()`?



-- 
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