Add support for quorum#62
Conversation
Initial commit is simple in that we accept a vec of SocketAddr instead, this allows us to supply multiple hosts, where following the java docs it will shuffle the vec to provide a random candidate.
|
Hi @richardbadman , thank you for tackling this. You did the first part of #6 (connect). tokio-zookeeper/src/proto/packetizer.rs Line 257 in 9c5f622 Currently the Packetizer holds a single addr and does not shuffle for reconnects. So if that server dies we retry that servrer forever and never fail over. The state is tokio-zookeeper/src/proto/packetizer.rs Line 236 in 9c5f622 Could you move the shuffled list into Packetizer and rotate through it on reconnect? For the expiry and persist the quorum information question: Yes that is the reconnect part. A disconnect is recoverable, an expiry is not. On reconnect we resend Right now we never look: the reconnect handshake response goes into a oneshot that's only traced tokio-zookeeper/src/proto/packetizer.rs Line 270 in 9c5f622 This is not part of this PR (and a general mess), since it also touches leader election... One thing that might be worth considering is Small things for later:
Malte |
This is in response to Issue #6.
Initial commit is simple in that we accept a vec of SocketAddr instead, this allows us to supply multiple hosts, where following the java docs it will shuffle the vec to provide a random candidate.
From the issue there is a comment of;
But I'm not entirely sure what this means. So I'm happy for advice/pointers or more explanation.
I'm not expecting this to be the final complete solution either, for example, I was wondering if we wanted to persist the overall quorum information incase of connection error/dropped