dotnet / dotNext

Next generation API for .NET
https://dotnet.github.io/dotNext/
MIT License
1.6k stars 119 forks source link

running RaftNode example in tcp mode. All nodes become leader #81

Closed sakno closed 2 years ago

sakno commented 2 years ago

Discussed in https://github.com/dotnet/dotNext/discussions/80

Originally posted by **AntonWerenberg** October 28, 2021 When attempting to run the unmodified RaftNode example for tcp nodes I encounter problems. all running are in the leader state and appear not to interact with each other. Upon closer inspection, I have found that the memberlist of each node only contains itself. I suspect that the problem may be because the node is configured with coldstart = true. Could this be the case? Upon reading the documentation I am in doubt whether only a single node should be configured with coldstart = true. When running the example with http configuration everything runs flawlessly. commands run in seperate teminals when starting example in tcp mode ~/dotNext/src/examples/RaftNode$ dotnet run --framework net6.0 tcp 3262 node1 ~/dotNext/src/examples/RaftNode$ dotnet run --framework net6.0 tcp 3263 node2 ~/dotNext/src/examples/RaftNode$ dotnet run --framework net6.0 tcp 3264 node3
sakno commented 2 years ago

coldstart must be false. Raft example has been fixed in 4.0.0-beta.9.