-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: Cluster Management
-
None
The logic should be
- Remove all nodes no longer present in the SRV response.
- Find all new nodes to add from the SRV response.
- Shuffle the new nodes (and only the new nodes).
- Select and add the first srvMaxHosts - numCurrentEndPoints + numRemovedEndPoints. Note that numCurrentEndPoints is the number prior to removing any. So it's not double-counting removed endpoints.
The net result is that it will keep existing nodes, discard deleted nodes, and fill up to srvMaxHosts from a random shuffle of newly discovered nodes from the SRV response.
The current behavior is:
- Find all nodes from the SRV response.
- Shuffle them
- Select and add the first srvMaxHosts nodes
Also implement the prose test:
Start with 27017, and 27018. Then replace the 27018 record with two additional records so you have: 27017, 27019, 27020. Assert that the topology has two hosts present and that one of the hosts is localhost.test.build.10gen.cc:27017. The second, new host will have been randomly selected
- is related to
-
DRIVERS-1981 Reconsider interaction between srvMaxHosts and SRV polling
- Backlog
- related to
-
JAVA-4252 Provide options to limit number of mongos servers used in connecting to sharded clusters
- Closed