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

Zili Chen commented on RATIS-121:
---------------------------------

[~szetszwo] that's a case to explain the problem. It makes no sense to remove 
the serverId part form Counter example. If I change,

this.server = RaftServer.newBuilder()
.setGroup(Constants.RAFT_GROUP)
.setProperties(properties)
.setServerId(peer.getId())
.setStateMachine(counterStateMachine)
.build();

to

this.server = RaftServer.newBuilder()
.setGroup(Constants.RAFT_GROUP)
.setProperties(properties)
// .setServerId(peer.getId()) // comment out
.setStateMachine(counterStateMachine)
.build();

The config is invalid. However, the server can start normally because we auto 
generate serverId. In this case the client cannot connect to the server.?

Thus, the question is, shall we automatically generate serverId only if {{id == 
null && group is empty}} instead of {{{}id == null{}}}?

I expect the wrong config cause an exception when constructing server instead 
of normally starting the server but in an unhealthy state.

Correct me if this is a valid state.

> In RaftServer.Builder, allow serverId and group to be initialized 
> automatically
> -------------------------------------------------------------------------------
>
>                 Key: RATIS-121
>                 URL: https://issues.apache.org/jira/browse/RATIS-121
>             Project: Ratis
>          Issue Type: Improvement
>          Components: server
>            Reporter: Tsz-wo Sze
>            Assignee: Tsz-wo Sze
>            Priority: Major
>             Fix For: 0.2.0
>
>         Attachments: r121_20171013.patch
>
>
> When the serverId is missing, it can be initialized automatically using the 
> given properties such as host and port.
> Also, the group should be automatically initialized to an empty group since 
> group may not be known when starting a server.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to