Closed dpasek-senacor closed 3 years ago
@YoEight
I have added some more test cases on the NodeSelector
Theres is a miniscule chance that tests break if rolling the dice 100 times on node selection is not enough. 😉
we'll also need to tune it a bit to be aligned with the Reconnection RFC
@oskardudycz Where can I find this RFC? :)
@ahjohannessen so far is internal, but I hope that we'll be able to show it publicly soon. If not through RFC, then maybe at least through docs 🙂
@oskardudycz ok, would be nice to have such that unofficial clients have some guide lines to follow :)
@ahjohannessen, we want to be more open, not only in regards to the results and ask in advance for suggestions. To do that, we have to sort the RFC process internally (almost there 😉 ) then find a sustainable way to make that public. I'm sure that this will happen soon (no exact timeframe tho).
Regarding specs for unofficial clients, that's also on our TODO list. We won't be able to maintain all the languages, so for sure, we're taking that into account to work closely with the community 👍
This fixes https://github.com/EventStore/EventStoreDB-Client-Java/issues/83
Currently the node selection strategy always produces stable result always prefering a single node of the specified category. Always the same follower or read-only replica is selected based on the
ClusterInfo
retrieved from the seed node.Even the
NodePreference.RANDOM
currently will always result in the same node to be returned to the client if theMember
in theClusterInfo
will not change.This PR properly performs random selection of nodes in each category. It also extracts the algorithm of the node selection into dedicated class for better testability.