You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Jing Zhao (JIRA)" <ji...@apache.org> on 2017/09/04 21:16:02 UTC

[jira] [Commented] (RATIS-105) Server should check group id for client requests

    [ https://issues.apache.org/jira/browse/RATIS-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152941#comment-16152941 ] 

Jing Zhao commented on RATIS-105:
---------------------------------

The patch needs a minor fix to compile:
{code}
diff --git a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
index b227e47..7e08809 100644
--- a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
@@ -80,7 +80,7 @@ public abstract class RaftBasicTests extends BaseTest {
     LOG.info(cluster.printServers());
 
     final SimpleMessage[] messages = SimpleMessage.create(10);
-    try(final RaftClient client = cluster.createClient(null)) {
+    try(final RaftClient client = cluster.createClient()) {
       for (SimpleMessage message : messages) {
         client.send(message);
       }
@@ -149,7 +149,7 @@ public abstract class RaftBasicTests extends BaseTest {
 
     final List<Client4TestWithLoad> clients
         = Stream.iterate(0, i -> i+1).limit(numClients)
-        .map(i -> cluster.createClient(null))
+        .map(i -> cluster.createClient())
         .map(c -> new Client4TestWithLoad(c, numMessages))
         .collect(Collectors.toList());
     clients.forEach(Thread::start);
diff --git a/ratis-server/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java b/ratis-server/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
index f41e764..73ce69d 100644
--- a/ratis-server/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
+++ b/ratis-server/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
@@ -156,7 +156,7 @@ public class TestStateMachine extends BaseTest {
 
     int numTrx = 100;
     final RaftTestUtil.SimpleMessage[] messages = RaftTestUtil.SimpleMessage.create(numTrx);
-    try(final RaftClient client = cluster.createClient(null)) {
+    try(final RaftClient client = cluster.createClient()) {
       for (RaftTestUtil.SimpleMessage message : messages) {
         client.send(message);
       }
{code}

I will commit the patch along with the fix.

> Server should check group id for client requests 
> -------------------------------------------------
>
>                 Key: RATIS-105
>                 URL: https://issues.apache.org/jira/browse/RATIS-105
>             Project: Ratis
>          Issue Type: Improvement
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>         Attachments: r105_20170814.patch, r105_20170815.patch, r105_20170821.patch
>
>
> In RATIS-100, we found a bug that a server may response to another server with different group so that a cluster with multiple groups may not work correctly.  The solution is to check the group id for each server request before responding to it.
> In this JIRA, we add a similar group id check for the client requests.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)