Closed danthegoodman1 closed 1 week ago
What we need to do is override the initialMembers to nothing if join is provided, and non-initial nodes should always leave join provided
Or even better, we just detect whether it's an initial node or not based on it's URL and the initialMembers
Initial cluster will bootstrap with shard 0
kinds of depends on shard creation, but mostly done
The issue is that node join support is not super elegant https://pkg.go.dev/github.com/lni/dragonboat/v4#NodeHost.StartReplica
This means we have to know between an initial join, and a restart. We also need to know if it's an initial member or not. It seems that the initial member is not damaging when recovering: https://github.com/lni/dragonboat-example/blob/master/helloworld/main.go#L128C2-L132C25
The reason is that dragonboat "recruits" members my reaching out to them and telling them to join, so they need to understand that they are in the join phase. In order to handle joining, it would be nice if we can detect that this is not an initial member, and if there's local state of already being in a cluster.