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

Tsz Wo Nicholas Sze edited comment on RATIS-97 at 7/31/17 9:20 PM:
-------------------------------------------------------------------

> ... a new leader needs to get majority from both the old configuration and 
> the new configuration, ...

But how would the new servers know about the old configuration in the first 
place?  Currently, we just start new servers with one configuration.

> Do you have a test case for this scenario, Nicholas?

Yes, I discovered this bug from RATIS-96.  With the patch there, we can easily 
modify testReinitialize9Nodes.  Then run it with Grpc repeatedly.  It should 
fail within a few times.
{code}
diff --git 
a/ratis-server/src/test/java/org/apache/ratis/server/impl/ReinitializationBaseTest.java
 
b/ratis-server/src/test/java/org/apache/ratis/server/impl/ReinitializationBaseTest.java
index 20b8680..f4ce320 100644
--- 
a/ratis-server/src/test/java/org/apache/ratis/server/impl/ReinitializationBaseTest.java
+++ 
b/ratis-server/src/test/java/org/apache/ratis/server/impl/ReinitializationBaseTest.java
@@ -106,7 +106,7 @@ public abstract class ReinitializationBaseTest {
   @Test
   public void testReinitialize9Nodes() throws Exception {
     final int[] idIndex = {5, 8, 9};
-    runTestReinitializeMultiGroups(idIndex, 0);
+    runTestReinitializeMultiGroups(idIndex, 2);
   }
 
   private void runTestReinitializeMultiGroups(int[] idIndex, int chosen) 
throws Exception {
{code}


was (Author: szetszwo):
> ... a new leader needs to get majority from both the old configuration and 
> the new configuration, ...

But how would the new servers know about the old configuration in the first 
place?  Currently, we just start new servers with one configuration.

> Do you have a test case for this scenario, Nicholas?

Yes, I discovered this bug from RATIS-96.  With the patch there, we can easily 
add a test.
{code}
  @Test
  public void testReinitialize9Nodes() throws Exception {
    final int[] idIndex = {3, 9};
    runTestReinitializeMultiGroups(idIndex, 0);
  }
{code}

> Leader may not have majority after setConfiguration
> ---------------------------------------------------
>
>                 Key: RATIS-97
>                 URL: https://issues.apache.org/jira/browse/RATIS-97
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>         Attachments: r97_20170728.patch
>
>
> Here is an example: Suppose a group has 3 servers and one of them is the 
> leader.  Use setConfiguration to add 6 more servers.  The leader is still 
> running as a leader although it does not has majority anymore.  The 6 new 
> servers may elect a new leader among them.  Finally, there are two leaders in 
> the group.



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

Reply via email to