Currently, raft IDs are randomly generated on the client side before joining the cluster. If the ID it generates collides with an ID that's already in use, this is not handled gracefully.
There are two ways I can see to handle this properly:
- Generate raft IDs on the server side: Have the
Join RPC call to respond with a valid ID. This either requires that Join requests are forwarded to the leader, or that Join retries proposing a configuration change until one gets committed with an ID that doesn't conflict with anything else in the log. The logic around this could be a bit complex.
- Continue to generate the ID client-side, but have the
Join RPC call return an error if the ID is not unique (after the ProposeConfChange raft round). Have the client retry with a different ID.
cc @abronan
Currently, raft IDs are randomly generated on the client side before joining the cluster. If the ID it generates collides with an ID that's already in use, this is not handled gracefully.
There are two ways I can see to handle this properly:
JoinRPC call to respond with a valid ID. This either requires thatJoinrequests are forwarded to the leader, or thatJoinretries proposing a configuration change until one gets committed with an ID that doesn't conflict with anything else in the log. The logic around this could be a bit complex.JoinRPC call return an error if the ID is not unique (after the ProposeConfChange raft round). Have the client retry with a different ID.cc @abronan